无法运行我的Django App服务器

时间:2014-09-10 07:23:23

标签: python django

我无法为我的Django应用程序运行我的服务器。以下是自上次工作以来发生的事情的历史记录:

我的计算机遇到了一些麻烦,所以我将我的项目保存在一台服务器中,并在服务器上使用代码工作了两周,以检查我是否可以在没有问题的情况下进行开发(从开始就一切顺利)。然后我将我的电脑格式化了,所以我再次安装了所有电脑。

当试图运行python manage.py runserver command时,它要求我在我的需求文件中安装所有内容。我这样做了。

现在已经安装了所有需求(或者至少我认为是这样),但是在运行命令时,这是我得到的:

(是的,我试过syncdb

$ python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 354, in execute
django.setup()
File "/Library/Python/2.7/site-packages/django/__init__.py", line 21, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Library/Python/2.7/site-packages/django/apps/registry.py", line 108, in populate
app_config.import_models(all_models)
File "/Library/Python/2.7/site-packages/django/apps/config.py", line 197, in import_models
self.models_module = import_module(models_module_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Library/Python/2.7/site-packages/tastypie/models.py", line 32, in <module>
from tastypie.compat import AUTH_USER_MODEL
File "/Library/Python/2.7/site-packages/tastypie/compat.py", line 14, in <module>
User = get_user_model()
File "/Library/Python/2.7/site-packages/django/contrib/auth/__init__.py", line 136, in get_user_model
return django_apps.get_model(settings.AUTH_USER_MODEL)
File "/Library/Python/2.7/site-packages/django/apps/registry.py", line 199, in get_model
self.check_models_ready()
File "/Library/Python/2.7/site-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.

任何想法??

由于

1 个答案:

答案 0 :(得分:4)

您安装django 1.7,但您的项目是最老的django版本

阅读release notes有关新版本的更改,或切换回最早的django。