django - KeyError: 'DATABASE_URL' -
i need issue.
when start processes locally using foreman start output.
21:59:18 web.1 | db_uri = os.environ['database_url'] 21:59:18 web.1 | file "/users/radhikasrinivasan/myproject/venv/bin/../lib/python2.7/userdict.py", line 23, in __getitem__ 21:59:18 web.1 | raise keyerror(key) 21:59:18 web.1 | keyerror: 'database_url' 21:59:18 web.1 | exited code 1 21:59:18 system | sending sigterm processes sigterm received
in settings.py if helps. when app deployed in heroku in heroku postgres :: orange
databases = { 'default': { 'engine': 'django.db.backends.sqlite3', #'engine': 'django.db.backends.postgresql_psycopg2', #'name': os.path.join(base_dir, 'db.sqlite3'), } } #connecting django import dj_database_url databases['default'] = dj_database_url.config(default='sqlite://db/sqlite3.db')
thank you, rads
it means don't have environment variable database_url
declared, or visible in os.environ
dict.
edit
not heroku expert, maybe should follow this:
https://devcenter.heroku.com/articles/config-vars#setting-up-config-vars-for-a-deployed-application
Comments
Post a Comment