[Django] #21737: ImproperlyConfigured hidden, which causes hard to debug errors

26 views
Skip to first unread message

Django

unread,
Jan 6, 2014, 9:55:36 AM1/6/14
to django-...@googlegroups.com
#21737: ImproperlyConfigured hidden, which causes hard to debug errors
------------------------------------------------+------------------------
Reporter: apollo13 | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
Putting an `AppConfig` without a `name` attribute into `INSTALLED_APPS`
raises this nice error:
{{{
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File
"/home/florian/sources/django.git/django/core/management/__init__.py",
line 426, in execute_from_command_line
utility.execute()
File
"/home/florian/sources/django.git/django/core/management/__init__.py",
line 418, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File
"/home/florian/sources/django.git/django/core/management/__init__.py",
line 280, in fetch_command
commands = get_commands()
File "/home/florian/.virtualenvs/conticki/lib/python3.4/functools.py",
line 427, in wrapper
result = user_function(*args, **kwds)
File
"/home/florian/sources/django.git/django/core/management/__init__.py",
line 118, in get_commands
app_configs = apps.get_app_configs()
File "/home/florian/sources/django.git/django/apps/registry.py", line
121, in get_app_configs
self.check_ready()
File "/home/florian/sources/django.git/django/apps/registry.py", line
115, in check_ready
raise RuntimeError("App registry isn't ready yet.")
RuntimeError: App registry isn't ready yet.
}}}

This is due to the fact that `d.c.management` ignores
`ImproperlyConfigured` from `django.setup`

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

Django

unread,
Jan 6, 2014, 2:07:43 PM1/6/14
to django-...@googlegroups.com
#21737: ImproperlyConfigured hidden, which causes hard to debug errors
--------------------------------------+------------------------------------

Reporter: apollo13 | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Uncategorized | Version: master
Severity: Release blocker | Resolution:
Keywords: app-loading | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by charettes):

* keywords: => app-loading
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted


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

Django

unread,
Jan 6, 2014, 4:56:17 PM1/6/14
to django-...@googlegroups.com
#21737: ImproperlyConfigured hidden, which causes hard to debug errors
--------------------------------------+------------------------------------

Reporter: apollo13 | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Uncategorized | Version: master
Severity: Release blocker | Resolution:
Keywords: app-loading | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by claudep):

* has_patch: 0 => 1
* needs_tests: 0 => 1


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

Django

unread,
Jan 6, 2014, 5:05:09 PM1/6/14
to django-...@googlegroups.com
#21737: ImproperlyConfigured hidden, which causes hard to debug errors
--------------------------------------+------------------------------------
Reporter: apollo13 | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Uncategorized | Version: master
Severity: Release blocker | Resolution: fixed

Keywords: app-loading | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Aymeric Augustin <aymeric.augustin@…>):

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


Comment:

In [changeset:"2dcde523abe6dca42d9b2d46a47c402979974c77"]:
{{{
#!CommitTicketReference repository=""
revision="2dcde523abe6dca42d9b2d46a47c402979974c77"
Avoided catching ImproperlyConfigured on django.setup().

Fixed #21737. Thanks Florian for the report.

Also removed redundant imports in that file.
}}}

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

Django

unread,
Jan 6, 2014, 5:19:02 PM1/6/14
to django-...@googlegroups.com
#21737: ImproperlyConfigured hidden, which causes hard to debug errors
--------------------------------------+------------------------------------
Reporter: apollo13 | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Uncategorized | Version: master

Severity: Release blocker | Resolution: fixed
Keywords: app-loading | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by aaugustin):

Oops - we worked on the same ticket at the same time.

But we came up with pretty much the same solution.

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

Django

unread,
Jan 7, 2014, 6:20:16 AM1/7/14
to django-...@googlegroups.com
#21737: ImproperlyConfigured hidden, which causes hard to debug errors
--------------------------------------+------------------------------------
Reporter: apollo13 | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Uncategorized | Version: master

Severity: Release blocker | Resolution: fixed
Keywords: app-loading | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by claudep):

Thanks, your solution is more elegant.

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

Reply all
Reply to author
Forward
0 new messages