[Django] #27033: static tag causes AppRegistryNotReady errors on 1.10

24 views
Skip to first unread message

Django

unread,
Aug 8, 2016, 5:21:29 AM8/8/16
to django-...@googlegroups.com
#27033: static tag causes AppRegistryNotReady errors on 1.10
-----------------------------------------------+------------------------
Reporter: apollo13 | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.staticfiles | Version: 1.10
Severity: Release blocker | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------------+------------------------
See the trace:
{{{
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-
packages/django/core/management/__init__.py", line 367, in
execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-
packages/django/core/management/__init__.py", line 341, in execute
django.setup()
File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line
27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py",
line 85, in populate
app_config = AppConfig.create(entry)
File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py",
line 90, in create
module = import_module(entry)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
import_module
__import__(name)
File "/home/anon/.local/lib/python2.7/site-
packages/easy_select2/__init__.py", line 7, in <module>
from easy_select2.utils import (
File "/home/anon/.local/lib/python2.7/site-
packages/easy_select2/utils.py", line 6, in <module>
from easy_select2.widgets import Select2Mixin, Select2,
Select2Multiple
File "/home/anon/.local/lib/python2.7/site-
packages/easy_select2/widgets.py", line 16, in <module>
static('easy_select2/js/easy_select2.js'),
File "/usr/local/lib/python2.7/dist-
packages/django/templatetags/static.py", line 163, in static
return StaticNode.handle_simple(path)
File "/usr/local/lib/python2.7/dist-
packages/django/templatetags/static.py", line 112, in handle_simple
if apps.is_installed('django.contrib.staticfiles'):
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py",
line 225, in is_installed
self.check_apps_ready()
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py",
line 124, in check_apps_ready
raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
}}}

Marking as RB till we know how we want to handle ot.

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

Django

unread,
Aug 8, 2016, 5:22:41 AM8/8/16
to django-...@googlegroups.com
#27033: static tag causes AppRegistryNotReady errors on 1.10
-------------------------------------+------------------------------------

Reporter: apollo13 | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.staticfiles | Version: 1.10
Severity: Release blocker | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------
Description changed by apollo13:

Old description:

New description:

Marking as RB till we know how we want to handle it. Do we have a way to
check if the app is installed without triggering app registry ready
checks?

--

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

Django

unread,
Aug 8, 2016, 7:42:53 AM8/8/16
to django-...@googlegroups.com
#27033: static tag causes AppRegistryNotReady errors on 1.10
-------------------------------------+------------------------------------

Reporter: apollo13 | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.staticfiles | Version: 1.10
Severity: Release blocker | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------

Comment (by claudep):

Seems like the more recent easy_select2 doesn't suffer from this any more
(https://github.com/asyncee/django-easy-select2/commit/8b9a4f050166).

If we really want to be able to use `static()` before/during app
population we could catch the exception and return some lazy object. Not
sure about that.

At a minimum, release notes should be updated.

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

Django

unread,
Aug 8, 2016, 1:26:12 PM8/8/16
to django-...@googlegroups.com
#27033: static tag causes AppRegistryNotReady errors on 1.10
-------------------------------------+------------------------------------

Reporter: apollo13 | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.staticfiles | Version: 1.10
Severity: Release blocker | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------

Comment (by timgraham):

I think the use case of the project is obsoleted by the commit that caused
the regression: cf546e11ac76c8dec527e39ff8ce8249a195ab42 allows form
`Media` to use staticfiles automatically without having to call `static()`
on each file. If we have to add a release note about this, I suggest
something like "`django.templatetags.static.static()` now raises
`AppRegistryNotReady` if called at application loading time." I think it's
likely to be a rare issue and probably wouldn't happen in django-easy-
select2 if convenience imports weren't provided in the project's
`__init__.py`.

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

Django

unread,
Aug 8, 2016, 1:42:03 PM8/8/16
to django-...@googlegroups.com
#27033: static tag causes AppRegistryNotReady errors on 1.10
-------------------------------------+------------------------------------
Reporter: apollo13 | Owner: nobody
Type: Uncategorized | Status: closed
Component: contrib.staticfiles | Version: 1.10
Severity: Release blocker | Resolution: wontfix

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------
Changes (by apollo13):

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


Comment:

Seems legit, just wanted another opinion :D

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

Reply all
Reply to author
Forward
0 new messages