我正在尝试从 Django 项目网站上的第一个教程中学习 Django。我可能遗漏了一些明显的东西,但是在我运行命令时遵循了所有说明
python manage.py runserver
我在此请求帮助的末尾发布了错误(为简洁起见,我只发布了错误消息重复行的前几行)。
以下是我在网上找到的一些解决方案/建议,但对我没有帮助。
1)sys.setrecursionlimit(1500)。
这对我不起作用。
2)。Django RuntimeError:超出最大递归深度
这也不是一个选项,因为我没有使用 PyDeV,我尝试使用 pip 卸载和安装 Django,它没有修复任何问题,我使用的是 Mountain Lion 的本机 python,我不会卸载它,因为不推荐.
3)。我也试过:
python manage.py runserver --settings=mysite.settings
与没有选项设置的命令完全相同的错误
任何建议,建议将不胜感激。我正在使用.... Django 正式版。我使用 pip 和 Python 2.7.2 安装的 1.5.1
Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x10f7ee5d0>>
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 92, in inner_run
self.validate(display_num_errors=True)
File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 280, in validate
num_errors = get_validation_errors(s, app)
File "/Library/Python/2.7/site-packages/django/core/management/validation.py", line 35, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/Library/Python/2.7/site-packages/django/db/models/loading.py", line 166, in get_app_errors
self._populate()
File "/Library/Python/2.7/site-packages/django/db/models/loading.py", line 72, in _populate
self.load_app(app_name, True)
File "/Library/Python/2.7/site-packages/django/db/models/loading.py", line 96, in load_app
models = import_module('.models', app_name)
File "/Library/Python/2.7/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/Library/Python/2.7/site-packages/django/contrib/auth/models.py", line 370, in <module>
class AbstractUser(AbstractBaseUser, PermissionsMixin):
File "/Library/Python/2.7/site-packages/django/db/models/base.py", line 213, in __new__
new_class.add_to_class(field.name, copy.deepcopy(field))
File "/Library/Python/2.7/site-packages/django/db/models/base.py", line 265, in add_to_class
value.contribute_to_class(cls, name)
File "/Library/Python/2.7/site-packages/django/db/models/fields/__init__.py", line 257, in contribute_to_class
cls._meta.add_field(self)
File "/Library/Python/2.7/site-packages/django/db/models/options.py", line 179, in add_field
self.local_fields.insert(bisect(self.local_fields, field), field)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
RuntimeError: maximum recursion depth exceeded in cmp
更新:所以我最终做的是安装virtualbox,在其上安装免费的ubuntu,然后继续完成教程......哦,好吧!