Ich bekomme: "django.core.exceptions.AppRegistryNotReady: Modelle sind noch nicht geladen."Django: Benutzer Benutzermodell nicht geladen
Traceback (most recent call last):
File "./manage.py", line 8, in <module>
django.setup()
File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/usr/local/lib/python2.7/dist-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/daniel/testingChamber/djangoTut/home/__init__.py", line 1, in <module>
import views
File "/home/daniel/testingChamber/djangoTut/home/views.py", line 9, in <module>
from .forms import UserForm
File "/home/daniel/testingChamber/djangoTut/home/forms.py", line 4, in <module>
class UserForm(forms.ModelForm):
File "/home/daniel/testingChamber/djangoTut/home/forms.py", line 7, in UserForm
class Meta:
File "/home/daniel/testingChamber/djangoTut/home/forms.py", line 8, in Meta
model = get_user_model()
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/__init__.py", line 163, in get_user_model
return django_apps.get_model(settings.AUTH_USER_MODEL)
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 192, in get_model
self.check_models_ready()
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 131, in check_models_ready
raise AppRegistryNotReady("Models aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.
Ich weiß nicht, was passiert. Ich bin neu in Django.
Die Version, die ich verwende, ist 1.10.6 und Python 2.7.12.
Was ist der richtige Weg, dies zu tun?
http://stackoverflow.com/questions/25537905/django-1-7-throws-django-core-exceptions-appregistrynotready-model-arent-load – Mayank
Können Sie den vollständigen Traceback in Ihre Frage einfügen? Es würde helfen, das Problem zu diagnostizieren. –
In welcher App befindet sich 'UserForm'? Bitte zeigen Sie Ihre 'INSTALLED_APPS' Einstellung. – Alasdair