我有一个简单的django项目。在我的ubuntu中安装了python,django和mysql数据库来运行这个项目。为了运行我的项目,我首先尝试同步数据库。但是,当我尝试命令“python manage.py syndb”时,我收到以下错误:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 429, in execute_from_command_line
utility.execute()
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 252, in fetch_command
app_name = get_commands()[subcommand]
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 101, in get_commands
apps = settings.INSTALLED_APPS
File "/usr/lib/python2.7/dist-packages/django/utils/functional.py", line 276, in __getattr__
self._setup()
File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 42, in _setup
self._wrapped = Settings(settings_module)
File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 139, in __init__
logging_config_func(self.LOGGING)
File "/usr/lib/python2.7/logging/config.py", line 777, in dictConfig
dictConfigClass(config).configure()
File "/usr/lib/python2.7/logging/config.py", line 562, in configure
'filter %r: %s' % (name, e))
ValueError: Unable to configure filter 'require_debug_false': Cannot resolve 'django.utils.log.RequireDebugFalse': No module named RequireDebugFalse
我是python和django的新手。第一次这样做..
答案 0 :(得分:0)
django.utils.log.RequireDebugFalse
出现在Django 1.4.0中。难道你安装了较旧的Django版本吗?
答案 1 :(得分:0)
正如您在评论中所述,您从发行版的存储库中安装了Django。这些版本通常都很旧,而且看起来你已经安装了1.3版,现在有三个版本已经过时了。
您应删除该版本(使用apt-get remove
)并通过pip install django
从Python包索引安装当前版本。您可能需要先安装pip
, 可以使用apt-get
。