python – except AppRegistryNotReady


When developing a web resource in django, I decided to use the loginza application. An exception is thrown during setup:

Traceback (most recent call last):
  File "", line 9, in <module>
  File "/usr/local/lib/python2.7/dist-packages/django/", line 21, in setup
   File "/usr/local/lib/python2.7/dist-     packages/django/apps/", line 108, in populate
  File "/usr/local/lib/python2.7/dist-packages/django/apps/", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python2.7/importlib/", line 37, in import_module
  File "/usr/local/lib/python2.7/dist-packages/loginza/", line 7, in <module>
    User = get_user_model()
  File "/usr/local/lib/python2.7/dist-    packages/django/contrib/auth/", line 137, in get_user_model
    return django_apps.get_model(settings.AUTH_USER_MODEL)
  File "/usr/local/lib/python2.7/dist-    packages/django/apps/", line 199, in get_model
  File "/usr/local/lib/python2.7/dist-    packages/django/apps/", line 131, in check_models_ready
    raise AppRegistryNotReady("Models aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.

I read the documentation and checked all the options that are indicated there. Same result. As soon as I remove the loginza application from INSTALLED_APPS, the project starts immediately without problems.


if __name__ == "__main__":
    import django

    from import execute_from_command_line


We also created our own User class:

AUTH_USER_MODEL = 'registration.CustomerUser'

What could be the problem?


Apparently we are talking about this package – django-loginza . The same problem as yours is described here . The author of the package, judging by the comments, fixed this problem, but judging by the pypi, he did not upload the updates. Try removing the package and installing the dev version from GitHub:

pip uninstall django-loginza
pip install -e git+
Scroll to Top