[Django] #29128: makemigrations raises AppRegistryNotReady instead of ImproperlyConfigured in Django 2.0

13 views
Skip to first unread message

Django

unread,
Feb 12, 2018, 2:56:23 PM2/12/18
to django-...@googlegroups.com
#29128: makemigrations raises AppRegistryNotReady instead of ImproperlyConfigured
in Django 2.0
-------------------------------------+-------------------------------------
Reporter: Jaye | Owner: nobody
Doepke |
Type: Bug | Status: new
Component: Core | Version: 2.0
(Management commands) | Keywords: migrations
Severity: Normal | makemigrations
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
In Django 2.0 with settings that should raise
`django.exceptions.ImproperlyConfigured`, running `manage.py
makemigrations` will raise `django.exceptions.AppRegistryNotReady`
instead. This does not occur in Django 1.11.

**Steps to Reproduce:**

{{{
$ django-admin startproject example_project .
$ echo 'SECRET_KEY = None' >> example_project/settings.py
$ ./manage.py makemigrations
Traceback (most recent call last):
File "./manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/home/jdoepke/Development/django_test/.venv/lib/python3.6/site-
packages/django/core/management/__init__.py", line 371, in
execute_from_command_line
utility.execute()
File "/home/jdoepke/Development/django_test/.venv/lib/python3.6/site-
packages/django/core/management/__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/jdoepke/Development/django_test/.venv/lib/python3.6/site-
packages/django/core/management/__init__.py", line 216, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/home/jdoepke/Development/django_test/.venv/lib/python3.6/site-
packages/django/core/management/__init__.py", line 36, in
load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File
"/home/jdoepke/Development/django_test/.venv/lib/python3.6/importlib/__init__.py",
line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in
_find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in
_call_with_frames_removed
File "/home/jdoepke/Development/django_test/.venv/lib/python3.6/site-
packages/django/core/management/commands/makemigrations.py", line 10, in
<module>
from django.db.migrations.autodetector import MigrationAutodetector
File "/home/jdoepke/Development/django_test/.venv/lib/python3.6/site-
packages/django/db/migrations/autodetector.py", line 11, in <module>
from django.db.migrations.questioner import MigrationQuestioner
File "/home/jdoepke/Development/django_test/.venv/lib/python3.6/site-
packages/django/db/migrations/questioner.py", line 9, in <module>
from .loader import MigrationLoader
File "/home/jdoepke/Development/django_test/.venv/lib/python3.6/site-
packages/django/db/migrations/loader.py", line 8, in <module>
from django.db.migrations.recorder import MigrationRecorder
File "/home/jdoepke/Development/django_test/.venv/lib/python3.6/site-
packages/django/db/migrations/recorder.py", line 9, in <module>
class MigrationRecorder:
File "/home/jdoepke/Development/django_test/.venv/lib/python3.6/site-
packages/django/db/migrations/recorder.py", line 22, in MigrationRecorder
class Migration(models.Model):
File "/home/jdoepke/Development/django_test/.venv/lib/python3.6/site-
packages/django/db/models/base.py", line 100, in __new__
app_config = apps.get_containing_app_config(module)
File "/home/jdoepke/Development/django_test/.venv/lib/python3.6/site-
packages/django/apps/registry.py", line 244, in get_containing_app_config
self.check_apps_ready()
File "/home/jdoepke/Development/django_test/.venv/lib/python3.6/site-
packages/django/apps/registry.py", line 127, in check_apps_ready
raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29128>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 12, 2018, 3:10:44 PM2/12/18
to django-...@googlegroups.com
#29128: makemigrations raises AppRegistryNotReady instead of ImproperlyConfigured
in Django 2.0
-------------------------------------+-------------------------------------
Reporter: Jaye Doepke | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: 2.0
commands) |
Severity: Normal | Resolution:
Keywords: migrations | Triage Stage:
makemigrations | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

Could you [https://docs.djangoproject.com/en/dev/internals/contributing
/triaging-tickets/#bisecting-a-regression bisect] to find the commit where
the behavior changed?

--
Ticket URL: <https://code.djangoproject.com/ticket/29128#comment:1>

Django

unread,
Feb 12, 2018, 9:31:29 PM2/12/18
to django-...@googlegroups.com
#29128: makemigrations raises AppRegistryNotReady instead of ImproperlyConfigured
in Django 2.0
-------------------------------------+-------------------------------------
Reporter: Jaye Doepke | Owner: nobody
Type: Bug | Status: new

Component: Core (Management | Version: 2.0
commands) |
Severity: Normal | Resolution:
Keywords: migrations | Triage Stage: Accepted
makemigrations |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted


Comment:

Bisected to 13be45308045f522dfd1d0ff3da3cdc163bc521d.

--
Ticket URL: <https://code.djangoproject.com/ticket/29128#comment:2>

Django

unread,
Feb 20, 2018, 11:07:08 PM2/20/18
to django-...@googlegroups.com
#29128: makemigrations raises AppRegistryNotReady instead of ImproperlyConfigured
in Django 2.0
-------------------------------------+-------------------------------------
Reporter: Jaye Doepke | Owner:
| ChillarAnand
Type: Bug | Status: assigned

Component: Core (Management | Version: 2.0
commands) |
Severity: Normal | Resolution:
Keywords: migrations | Triage Stage: Accepted
makemigrations |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by ChillarAnand):

* owner: nobody => ChillarAnand
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/29128#comment:3>

Django

unread,
Feb 22, 2018, 8:22:03 AM2/22/18
to django-...@googlegroups.com
#29128: makemigrations raises AppRegistryNotReady instead of ImproperlyConfigured
in Django 2.0
-------------------------------------+-------------------------------------
Reporter: Jaye Doepke | Owner:
| ChillarAnand
Type: Bug | Status: assigned
Component: Core (Management | Version: 2.0
commands) |
Severity: Normal | Resolution:
Keywords: migrations | Triage Stage: Accepted
makemigrations |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Patryk Zawadzki):

* cc: Patryk Zawadzki (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/29128#comment:4>

Django

unread,
May 17, 2018, 9:06:48 AM5/17/18
to django-...@googlegroups.com
#29128: makemigrations raises AppRegistryNotReady instead of ImproperlyConfigured
in Django 2.0
-------------------------------------+-------------------------------------
Reporter: Jaye Doepke | Owner:
| ChillarAnand
Type: Bug | Status: assigned
Component: Core (Management | Version: 2.0
commands) |
Severity: Normal | Resolution:
Keywords: migrations | Triage Stage: Accepted
makemigrations |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Evgeny Arshinov):

* cc: Evgeny Arshinov (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/29128#comment:5>

Django

unread,
Jun 26, 2018, 4:25:13 PM6/26/18
to django-...@googlegroups.com
#29128: makemigrations raises AppRegistryNotReady instead of ImproperlyConfigured
in Django 2.0
-------------------------------------+-------------------------------------
Reporter: Jaye Doepke | Owner:
| ChillarAnand
Type: Bug | Status: closed

Component: Core (Management | Version: 2.0
commands) |
Severity: Normal | Resolution: fixed

Keywords: migrations | Triage Stage: Accepted
makemigrations |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* status: assigned => closed
* resolution: => fixed


Comment:

This has been fixed by [d65b0f72de8d35617fe0554ddabc950c7f323eef].

--
Ticket URL: <https://code.djangoproject.com/ticket/29128#comment:6>

Reply all
Reply to author
Forward
0 new messages