0

I want to create a new app using 'python manage.py startapp' in my files but I am getting this error.

raise ImproperlyConfigured("settings.DATABASES is improperly configured. " django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.

here is the databases in my seetings.py:

DATABASES = {
    'default': dj_database_url.config(),

    
}

db_from_env = dj_database_url.config()
DATABASES['default'].update(db_from_env)

This is after migrating to heroku.

  • Does this answer your question? [Django DB Settings 'Improperly Configured' Error](https://stackoverflow.com/questions/15556499/django-db-settings-improperly-configured-error) – Rohit Aug 21 '20 at 06:48

1 Answers1

0

You have to tell django which DB engine you are using like MySQL, postgresql etc. So that django orm can prepare queries according to that. Otherwise it is not possible to run a db query from the orm. Please mention your settings in the below format -

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'OPTIONS': {
            'read_default_file': '/path/to/my.cnf',
        },
    }
}

Read more here - https://docs.djangoproject.com/en/3.1/ref/databases/#connecting-to-the-database

Arvind Kumar
  • 913
  • 10
  • 23