我正在尝试通过跟随this tutorial来学习django。我正在使用django版本1.1.1
我跑
django-admin.py startproject mysite
并创建它应该的文件。然后我尝试通过运行
来启动服务器python manage.py runserver
但是我收到以下错误。
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 362, in execute_manager
utility.execute()
File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 303, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 195, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 213, in execute
translation.activate('en-us')
File "/Library/Python/2.6/site-packages/django/utils/translation/__init__.py", line 73, in activate
return real_activate(language)
File "/Library/Python/2.6/site-packages/django/utils/translation/__init__.py", line 43, in delayed_loader
return g['real_%s' % caller](*args, **kwargs)
File "/Library/Python/2.6/site-packages/django/utils/translation/trans_real.py", line 205, in activate
_active[currentThread()] = translation(language)
File "/Library/Python/2.6/site-packages/django/utils/translation/trans_real.py", line 194, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File "/Library/Python/2.6/site-packages/django/utils/translation/trans_real.py", line 172, in _fetch
for localepath in settings.LOCALE_PATHS:
File "/Library/Python/2.6/site-packages/django/utils/functional.py", line 273, in __getattr__
return getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'LOCALE_PATHS'
现在,我可以添加一个LOCALE_PATH属性并设置为我的settings.py文件的空元组,但之后它只是抱怨另一个设置等等。我在这里缺少什么?
答案 0 :(得分:1)
django安装中有些东西坏了。也许你在路径的某个地方有一个(非常)旧版本?
LOCALE_PATHS was given a default value in the global settings file a long time ago
答案 1 :(得分:0)
无法真正解释这一点。尝试删除项目目录并重新开始。
您是否肯定在目录中使用设置文件运行manage.py
?