AppRegistryNotReady Exception on Django 1.10 Dev
See original GitHub issueWhen running ./manage.py migrate
on Django 1.10.dev20160413172854
throws the following exception. But changing to Django 1.9.5 works fine. Is there any fix to work with dev
version?
╰─$ ./manage.py migrate
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/dacodekid/dev/django/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/Users/dacodekid/dev/django/django/core/management/__init__.py", line 341, in execute
django.setup()
File "/Users/dacodekid/dev/django/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/dacodekid/dev/django/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/Users/dacodekid/dev/django/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/Users/dacodekid/.envs/tradex/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 662, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/Users/dacodekid/.envs/tradex/lib/python3.5/site-packages/django_q/__init__.py", line 15, in <module>
from .tasks import async, schedule, result, result_group, fetch, fetch_group, count_group, delete_group, queue_size
File "/Users/dacodekid/.envs/tradex/lib/python3.5/site-packages/django_q/tasks.py", line 11, in <module>
import cluster
File "/Users/dacodekid/.envs/tradex/lib/python3.5/site-packages/django_q/cluster.py", line 31, in <module>
import tasks
File "/Users/dacodekid/.envs/tradex/lib/python3.5/site-packages/django_q/tasks.py", line 13, in <module>
from django_q.models import Schedule, Task
File "/Users/dacodekid/.envs/tradex/lib/python3.5/site-packages/django_q/models.py", line 12, in <module>
class Task(models.Model):
File "/Users/dacodekid/dev/django/django/db/models/base.py", line 94, in __new__
app_config = apps.get_containing_app_config(module)
File "/Users/dacodekid/dev/django/django/apps/registry.py", line 239, in get_containing_app_config
self.check_apps_ready()
File "/Users/dacodekid/dev/django/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.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Django AppRegistryNotReady Exception after import from ...
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. I've tried with import Django and then django.setup() and it works but: ...
Read more >Django Exceptions
Django core exception classes are defined in django.core.exceptions . AppRegistryNotReady ¶. exception AppRegistryNotReady ...
Read more >Django AppRegistryNotReady error when importing models
You'll see this error if you try to run tests that import models, or if you try to import models in the Django...
Read more >Django upgrading to 1.9 error “AppRegistryNotReady: Apps ...
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. I modified the Installed apps for 'django.contrib.
Read more >Why getting django.core.exceptions.AppRegistryNotReady
You need to set correct python path to your user model, but not reference the model class object it self. Django needs to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It turned out to be a problem with the code that makes Django 1.8 and lower work. I’ve adjusted the code to allow for 1.10 versions. Also optparse is now deprecated, so I replaced that with argparse for the commands.
Should work on 1.10a1. Tests are passing on Travis.
Yes it can as far as I know. I’m now on 1.11 so I’m not using older versions.