Settings.DATABASES Is Improperly Configured. Please Supply The NAME Value
I know people asked similar question before. But it's all about the engine value. does any one know how do I solve this error with the NAME value? I deployed to heroku and everythi
Solution 1:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
is enough. And if you want to use django_postgrespool
, you can edit it above.
But your following lines:
DATABASES['default'] = dj_database_url.config()
DATABASES['default']['ENGINE'] = 'django_postgrespool'
is just overwriting the above standard DATABASE
settings. So you need to delete those 2 lines (or define it via dj_database_url
and remove the above snippet).
Solution 2:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
import dj_database_url
db_config = dj_database_url.config()
if db_config:
DATABASES['default'] = db_config
Solution 3:
In my case I was storing the whole DB url with password in an environment variable. I had set the password to contain @
which messed with the parsing of the rest of the string, therefore not detecting the name parameter. Just changed the password to not include any @
symbols.
Post a Comment for "Settings.DATABASES Is Improperly Configured. Please Supply The NAME Value"