I need help with this issue.
When I start processes locally using foreman start I get this 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 with code 1
21:59:18 system | sending SIGTERM to all processes
SIGTERM received
In settings.py if this helps. When the app is deployed in Heroku it is 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 with Django
import dj_database_url
DATABASES['default'] = dj_database_url.config(default='sqlite://db/sqlite3.db')
Thank you, Rads
It means you don't have an environment variable DATABASE_URL declared, or it would be visible in os.environ dict.
EDIT
Not a Heroku expert, but maybe you should follow this:
https://devcenter.heroku.com/articles/config-vars#setting-up-config-vars-for-a-deployed-application
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With