App Registry Not Ready while upgrading to Django 1.11 from 1.8

433 Views Asked by At

I'm facing this issue while upgrading to Django version 1.11. Here's the list of errors what I'm getting for Djagno auth user model.

File "/customer/models/customer.py"
    from django.contrib.auth.models import User
File "/environment/lib/python2.7/site-packages/django/contrib/auth/models.py"
    from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "/environment/lib/python2.7/site-packages/django/contrib/auth/base_user.py"
    class AbstractBaseUser(models.Model):
File "/environment/lib/python2.7/site-packages/django/db/models/base.py"
    app_config = apps.get_containing_app_config(module)
File "/environment/lib/python2.7/site-packages/django/apps/registry.py"
    self.check_apps_ready()
File "/environment/lib/python2.7/site-packages/django/apps/registry.py", in check_apps_ready
    raise AppRegistryNotReady("Apps aren't loaded yet.")

I've tried get_user_model() in the place of "import User" but got the same "AppRegistryNotReady('Apps aren't loaded yet.')" error.

Thanks in advance for your suggestions.

Edit: After adding Djagno.setup() after installed apps list. I've got this error: RuntimeError: Model class django.contrib.contenttypes.models.ContentType doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS

0

There are 0 best solutions below