当我输入python manage.py makemigrations
时,我得到了
Traceback(most recent call last):
File "manage.py", line 10, in < module >
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 327, in execute
django.setup()
File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 10 8, in populate
app_config.import_models(all_models)
File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name)
File "/var/www/project/app/app/places/models.py", line 13, in < module >
User = user_model()
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/__init__.py", line 150, 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 19 4, in get_model
self.check_models_ready()
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 13 1, in check_models_ready
raise AppRegistryNotReady("Models aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Models aren 't loaded yet.
我在很多网站上搜索过任何解决方案,但没有任何帮助。它是项目文件的问题还是django的问题?