Opened 10 years ago
Last modified 10 years ago
#24298 closed Bug
post-migrate handlers fail when DATABASES['default'] = {} — at Initial Version
Description ¶
On Django 1.7.4 the management command migrate --database=xxx
fails when DATABASES['default'] = {}
with django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.
.
On Django 1.7.3 it works fine.
To reproduct the problem:
- Create a new project
- Edit the settings.py this way:
DATABASES = { 'default': {}, 'mysite': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db_mysite.sqlite3'), } }
- Run
python manage.py migrate --database=mysite
Problem:
It seems Django tries to access the default connection. I found django.db.migrations.loader.is_latest_migration_applied
uses the default connection.
I am attaching an output log of the command.