3👍
I’m not sure exactly where the problem lies in dj_database_url
but reading through their github issues I think it’s a problem with some characters contained in the DATABASE_URL
environment variable.
In your settings.py
try using this instead of dj_database_url.parse()
:
... other config settings ...
DATABASE_URL = os.getenv('DATABASE_URL')
DATABASES = {
'default': dj_database_url.config(),
}
config()
should automatically use the DATABASE_URL
setting by default, so simply setting it from your environment variable first and then calling config()
after should bypass whatever problem the parse()
method in handling the url.
Source:stackexchange.com