[Django]-Settings.DATABASES is improperly configured. Please supply the NAME value

5👍

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).

3👍

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

0👍

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.

Leave a comment