Heroku Database Settings Injection - How do I setup my dev django database?

前端 未结 5 1844
孤城傲影
孤城傲影 2021-01-30 04:32

I\'m trying to get my local dev django app to work after following these instructions on adding env database settings.

https://devcenter.heroku.com/articles/django-injec

5条回答
  •  没有蜡笔的小新
    2021-01-30 05:02

    I just tried this and here is my code:

    import dj_database_url
    
    local_db = 'postgres://django_login:123456@localhost/django_db'
    DATABASES = {'default': dj_database_url.config(default=local_db)}
    

    My database name is "django_db", user name is "django_login", password is "123456".

    My code can run both in local machine and heroku.

提交回复
热议问题