-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix "RuntimeError: App registry isn't ready yet." with collectstatic #466
Fix "RuntimeError: App registry isn't ready yet." with collectstatic #466
Conversation
When invoking `collectstatic` on a Django 1.7 beta installation, the following error arises: File "venv/local/lib/python2.7/site-packages/debug_toolbar/models.py", line 63, in <module> patch_root_urlconf() File "venv/local/lib/python2.7/site-packages/debug_toolbar/models.py", line 51, in patch_root_urlconf reverse('djdt:render_panel') File "venv/src/django/django/core/urlresolvers.py", line 490, in reverse app_list = resolver.app_dict[ns] File "venv/src/django/django/core/urlresolvers.py", line 310, in app_dict self._populate() File "venv/src/django/django/core/urlresolvers.py", line 264, in _populate for pattern in reversed(self.url_patterns): File "venv/src/django/django/core/urlresolvers.py", line 348, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "venv/src/django/django/core/urlresolvers.py", line 342, in urlconf_module self._urlconf_module = import_module(self.urlconf_name) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/home/project/releases/master/project/config/urls.py", line 23, in <module> (r'^grappelli/', include('grappelli.urls')), File "venv/src/django/django/conf/urls/__init__.py", line 28, in include urlconf_module = import_module(urlconf_module) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "venv/src/django-grappelli-25x/grappelli/urls.py", line 12, in <module> from .views.switch import switch_user File "venv/src/django-grappelli-25x/grappelli/views/switch.py", line 18, in <module> User = get_user_model() File "venv/src/django/django/contrib/auth/__init__.py", line 129, in get_user_model return django_apps.get_model(settings.AUTH_USER_MODEL) File "venv/src/django/django/apps/registry.py", line 187, in get_model self.check_ready() File "venv/src/django/django/apps/registry.py", line 119, in check_ready raise RuntimeError("App registry isn't ready yet.") RuntimeError: App registry isn't ready yet.
it doesn´t make sense to patch against master, if it´s a backwards-incompatible change. this is only related to django 1.7, right? |
Yes, it's only relevant for Django 1.7. I've thought that master would get branched for 1.7 later? |
@blueyed You're right – I assumed you wanna merge this right now. |
No, but I wonder what Django version the master is targeting then, since there is the stable branch for Django 1.6 already? |
master is always targeting the latest stable release (see docs). there are actually 2 stable branches for different django-versions – IMO, it´s hard to follow another one (and just too much effort for us). besides, merging is always the better option ... but that probably requires another patch once we target django 1.7. the plan is to release another version with bugfixes and then start working on 1.7 (in about 3-4 weeks hopefully). |
@blueyed I'm not able to reproduce this error ... |
@sehmaschine |
@blueyed urls are being loaded. but I don´t understand how your next 2 questions are related to the topic ... in other words: what do I need to do in order to reproduce this error? do I need to use a custom user model? |
still not able to reproduce this! |
closing this since I've never been able to reproduce it ... please reopen with additional details if this error still exists. |
Yes. And then this also needs django-debug-toolbar's automatic patching to trigger it. I am not currently affected by this though anymore, because From the traceback:
It's OK to leave this closed for now. |
When invoking
collectstatic
on a Django 1.7 beta installation, thefollowing error arises:
This should probably use settings.AUTH_USER_MODEL in any case / or as fallback, but I was not sure how to handle it (seeing that django.utils.importlib is marked for deprecation already).