The issue appears to be in
django/core/management/commands/makemigrations.py
{{{
for db in connections:
loader.check_consistent_history(connections[db])
}}}
in settings.py:
{{{
DATABASES = {
'default': {},
'leftside': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db-left.sqlite3'),
},
'rightside': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db-right.sqlite3'),
}
}
}}}
Then create a model in an application and define a router for it, and
then run {{{manage.py makemigrations}}}
With 1.8 and other releases this will create the migrations, but current
version raises an error:
{{{
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/home/lemon/code/envs/dj34/lib/python3.4/site-
packages/django/core/management/__init__.py", line 367, in
execute_from_command_line
utility.execute()
File "/home/lemon/code/envs/dj34/lib/python3.4/site-
packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/lemon/code/envs/dj34/lib/python3.4/site-
packages/django/core/management/base.py", line 305, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/lemon/code/envs/dj34/lib/python3.4/site-
packages/django/core/management/base.py", line 356, in execute
output = self.handle(*args, **options)
File "/home/lemon/code/envs/dj34/lib/python3.4/site-
packages/django/core/management/commands/makemigrations.py", line 98, in
handle
loader.check_consistent_history(connections[db])
File "/home/lemon/code/envs/dj34/lib/python3.4/site-
packages/django/db/migrations/loader.py", line 276, in
check_consistent_history
applied = recorder.applied_migrations()
File "/home/lemon/code/envs/dj34/lib/python3.4/site-
packages/django/db/migrations/recorder.py", line 65, in applied_migrations
self.ensure_schema()
File "/home/lemon/code/envs/dj34/lib/python3.4/site-
packages/django/db/migrations/recorder.py", line 52, in ensure_schema
if self.Migration._meta.db_table in
self.connection.introspection.table_names(self.connection.cursor()):
File "/home/lemon/code/envs/dj34/lib/python3.4/site-
packages/django/db/backends/base/base.py", line 238, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "/home/lemon/code/envs/dj34/lib/python3.4/site-
packages/django/db/backends/dummy/base.py", line 21, in complain
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.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26930>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* severity: Normal => Release blocker
* needs_better_patch: => 0
* needs_tests: => 0
* version: master => 1.10
* needs_docs: => 0
* stage: Unreviewed => Accepted
Comment:
Regression in 1.10 due to 02ae5fd31a56ffb42feadb49c1f3870ba0a24869.
--
Ticket URL: <https://code.djangoproject.com/ticket/26930#comment:1>
Comment (by claudep):
That's what happen when fixes are committed without tests :-/
--
Ticket URL: <https://code.djangoproject.com/ticket/26930#comment:2>
* Attachment "26930-test.diff" added.
Failing test case
* Attachment "26930-patch.diff" added.
fixes the issue
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/26930#comment:3>
Comment (by lizlemon):
pull request
https://github.com/django/django/pull/6967
--
Ticket URL: <https://code.djangoproject.com/ticket/26930#comment:4>
* needs_better_patch: 0 => 1
Comment:
As noted on the PR, I don't using `is_usable()` is the best way to
identify the dummy database backend.
--
Ticket URL: <https://code.djangoproject.com/ticket/26930#comment:5>
* needs_better_patch: 1 => 0
Comment:
New [https://github.com/django/django/pull/6994 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/26930#comment:6>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"aad46c3e370e105f9117a337924090d05f1b001d" aad46c3]:
{{{
#!CommitTicketReference repository=""
revision="aad46c3e370e105f9117a337924090d05f1b001d"
Fixed #26930 -- Prevented makemigrations from accessing an empty database.
Thanks Liz Lemon for the report and investigation and
Claude Paroz for the test.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26930#comment:7>
Comment (by Tim Graham <timograham@…>):
In [changeset:"ddcf7dbae7f6e5fd3c3398aba13bf55b95c80a62" ddcf7dba]:
{{{
#!CommitTicketReference repository=""
revision="ddcf7dbae7f6e5fd3c3398aba13bf55b95c80a62"
[1.10.x] Fixed #26930 -- Prevented makemigrations from accessing an empty
database.
Thanks Liz Lemon for the report and investigation and
Claude Paroz for the test.
Backport of aad46c3e370e105f9117a337924090d05f1b001d from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26930#comment:8>