当前位置: 动力学知识库 > 问答 > 编程问答 >

python - manage.py runserver fails

问题描述:

OS X, Python 2.7, a fresh virtualenv:

virtualenv bar

source bar/bin/activate

pip install django --upgrade

django-admin.py startproject foo

cd foo

python manage.py runserver

Then I immediately get this:

Traceback (most recent call last):

File "manage.py", line 14, in <module>

execute_manager(settings)

File "/Users/xyz/.virtualenvs/bar/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager

utility.execute()

File "/Users/xyz/.virtualenvs/bar/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)

File "/Users/xyz/.virtualenvs/bar/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv

self.execute(*args, **options.__dict__)

File "/Users/xyz/.virtualenvs/bar/lib/python2.7/site-packages/django/core/management/base.py", line 209, in execute

translation.activate('en-us')

File "/Users/xyz/.virtualenvs/bar/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 100, in activate

return _trans.activate(language)

File "/Users/xyz/.virtualenvs/bar/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 43, in __getattr__

if settings.USE_I18N:

File "/Users/xyz/.virtualenvs/bar/lib/python2.7/site-packages/django/utils/functional.py", line 276, in __getattr__

self._setup()

File "/Users/xyz/.virtualenvs/bar/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup

self._wrapped = Settings(settings_module)

File "/Users/xyz/.virtualenvs/bar/lib/python2.7/site-packages/django/conf/__init__.py", line 139, in __init__

logging_config_func(self.LOGGING)

File "/Users/xyz/.virtualenvs/bar/lib/python2.7/site-packages/django/utils/dictconfig.py", line 553, in dictConfig

dictConfigClass(config).configure()

File "/Users/xyz/.virtualenvs/bar/lib/python2.7/site-packages/django/utils/dictconfig.py", line 321, in configure

del logging._handlerList[:]

AttributeError: 'module' object has no attribute '_handlerList'

What's going wrong?

网友答案:

This issue seems somehow related to virtualenvwrapper, and my own stupidity; creating a virtualenv manually has resolved it.

分享给朋友:
您可能感兴趣的文章:
随机阅读: