python:无法配置处理程序文件[Errno 2]没有这样的文件或目录

时间:2015-01-30 18:26:11

标签: python django python-2.7

我正在尝试启动服务器和运行的Web应用程序。但是我犯了这个错误:

C:\repositories\ABC\branches\user1\web_layer\service_layer>python mana
ge.py runserver 0.0.0.0:8000
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "C:\python27\lib\site-packages\django\core\management\__init__.py", line
385, in execute_from_command_line
    utility.execute()
  File "C:\python27\lib\site-packages\django\core\management\__init__.py", line
354, in execute
    django.setup()
  File "C:\python27\lib\site-packages\django\__init__.py", line 20, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "C:\python27\lib\site-packages\django\utils\log.py", line 87, in configur
e_logging
    logging_config_func(logging_settings)
  File "C:\python27\lib\logging\config.py", line 803, in dictConfig
    dictConfigClass(config).configure()
  File "C:\python27\lib\logging\config.py", line 585, in configure
    '%r: %s' % (name, e))
ValueError: Unable to configure handler 'file': [Errno 2] No such file or direct
ory: 'C:\\logs\\enforce_web.log'

C:\repositories\ABC\branches\user1\web_layer\service_layer>cd ../

有关如何解决此问题的任何建议?

1 个答案:

答案 0 :(得分:0)

这是系统特定的错误。&#34; C:\ logs \ enforce_web.log&#34;已被硬编码。您可以在项目的base.py中找到此行。在那里编辑它。设为filename': 'logger.log',