开发者

python manage.py runserver fails

I am trying to learn django by following along with this tutorial. I am using django version 1.1.1

I run

django-admin.py startproject mysite

and it creates the files it should. Then I try to start the server by running

python manage.py runserver

but here is where I get the following error.

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(sub开发者_如何学Pythoncommand).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'

Now, I can add a LOCALE_PATH atribute and set to an empty tuple to my settings.py file but then it just complains about another setting and so on. What am I missing here?


Something is broken in your django installation. maybe you have a (very) old version somewhere in the path?

LOCALE_PATHS was given a default value in the global settings file a long time ago.


Can't really explain that. Try removing the project directory and starting again.

Are you definitely running the manage.py from within the directory with the settings file?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜