0

I have upgraded django version from 1.8 into 1.9 and django rest framework to 3.3.3. I am getting this exception: django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

I have tried as follows but exception is still there.

#__init__.py
default_app_config = 'panel.apps.PanelConfig'

And also

#apps.py
from django.apps import AppConfig

class PanelConfig(AppConfig):
    name    = 'panel'

    def ready(self):
        from panel import receivers

for all apps and added these to installed apps

'api.apps.ApiConfig',
'billing.apps.ApiConfig',
'incoming.apps.IncomingConfig',
'outgoing.apps.OutgoingConfig',
'panel.apps.PanelConfig',

This is my full traceback:

Unhandled exception in thread started by <function wrapper at 0x7f3eec09c7d0>
Traceback (most recent call last):
  File "/home/sparrow/virtualenvs/bishnu/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/home/sparrow/virtualenvs/bishnu/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "/home/sparrow/virtualenvs/bishnu/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
    six.reraise(*_exception)
  File "/home/sparrow/virtualenvs/bishnu/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/home/sparrow/virtualenvs/bishnu/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/sparrow/virtualenvs/bishnu/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/home/sparrow/virtualenvs/bishnu/local/lib/python2.7/site-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/sparrow/virtualenvs/bishnu/local/lib/python2.7/site-packages/admin_tools/dashboard/__init__.py", line 1, in <module>
    from admin_tools.dashboard.dashboards import *
  File "/home/sparrow/virtualenvs/bishnu/local/lib/python2.7/site-packages/admin_tools/dashboard/dashboards.py", line 13, in <module>
    from django.contrib.contenttypes.models import ContentType
  File "/home/sparrow/virtualenvs/bishnu/local/lib/python2.7/site-packages/django/contrib/contenttypes/models.py", line 161, in <module>
    class ContentType(models.Model):
  File "/home/sparrow/virtualenvs/bishnu/local/lib/python2.7/site-packages/django/db/models/base.py", line 94, in __new__
    app_config = apps.get_containing_app_config(module)
  File "/home/sparrow/virtualenvs/bishnu/local/lib/python2.7/site-packages/django/apps/registry.py", line 239, in get_containing_app_config
    self.check_apps_ready()
  File "/home/sparrow/virtualenvs/bishnu/local/lib/python2.7/site-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.

Exception is still there ? What is the problem ? I am not getting ?

Bishnu Bhattarai
  • 2,800
  • 8
  • 36
  • 44
  • The full traceback might show you the import which is causing the problem. – Alasdair Apr 28 '16 at 08:51
  • I just googled the error and it came up with several StackOverflow pages with a few ideas that people say worked for them. Not going to reproduce them all here but is sounds like this error is not actually very descriptive of the root cause. – ElPedro Apr 28 '16 at 08:53
  • I have edited question with full traceback, can u help further ? – Bishnu Bhattarai Apr 28 '16 at 09:01

1 Answers1

0

The traceback shows you that the problem is occuring in admin_tools.

    from admin_tools.dashboard.dashboards import *
  File "/home/sparrow/virtualenvs/bishnu/local/lib/python2.7/site-packages/admin_tools/dashboard/dashboards.py", line 13, in <module>
    from django.contrib.contenttypes.models import ContentType

It looks like it has been fixed, so try upgrading to the latest release, currently 0.7.2.

Alasdair
  • 298,606
  • 55
  • 578
  • 516