Я пытаюсь развернуть Scrapy с помощью команды scrapyd-deploy
, и теперь она выдает следующую ошибку:
Packing version 1526919848
Deploying to project "first_scrapy" in http://my_ip:6800/addversion.json
Server response (200):
{"node_name": "polo", "message": "Traceback (most recent call last):\n File \"/usr/lib/python3.5/logging/config.py\", line 558, in configure\n handler = self.configure_handler(handlers[name])\n
File \"/usr/lib/python3.5/logging/config.py\", line 731, in configure_handler\n result = factory(**kwargs)\n File \"/usr/lib/python3.5/logging/__init__.py\", line 1008, in __init__\n StreamHandler.__init__(self, self._open())\n
File \"/usr/lib/python3.5/logging/__init__.py\", line 1037, in _open\n return open(self.baseFilename, self.mode, encoding=self.encoding)\nNotADirectoryError: [Errno 20] Not a directory: '/tmp/first_scrapy-1526919848-13w8cqlm.egg/debug.log'\n\nDuring handling of the above exception, another exception occurred:\n\n
Traceback (most recent call last):\n File \"/usr/lib/python3.5/runpy.py\", line 184, in _run_module_as_main\n \"__main__\", mod_spec)\n File \"/usr/lib/python3.5/runpy.py\", line 85, in _run_code\n exec(code, run_globals)\n
File \"/home/chiefir/lib/python3.5/site-packages/scrapyd/runner.py\", line 40, in <module>\n main()\n File \"/home/chiefir/lib/python3.5/site-packages/scrapyd/runner.py\", line 37, in main\n execute()\n File \"/home/chiefir/lib/python3.5/site-packages/scrapy/cmdline.py\", line 109, in execute\n settings = get_project_settings()\n
File \"/home/chiefir/lib/python3.5/site-packages/scrapy/utils/project.py\", line 68, in get_project_settings\n settings.setmodule(settings_module_path, priority='project')\n File \"/home/chiefir/lib/python3.5/site-packages/scrapy/settings/__init__.py\", line 292, in setmodule\n module = import_module(module)\n
File \"/home/chiefir/lib/python3.5/importlib/__init__.py\", line 126, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n
File \"<frozen importlib._bootstrap>\", line 986, in _gcd_import\n
File \"<frozen importlib._bootstrap>\", line 969, in _find_and_load\n
File \"<frozen importlib._bootstrap>\", line 958, in _find_and_load_unlocked\n
File \"<frozen importlib._bootstrap>\", line 664, in _load_unlocked\n
File \"<frozen importlib._bootstrap>\", line 634, in _load_backward_compatible\n
File \"/tmp/first_scrapy-1526919848-13w8cqlm.egg/first_scrapy/settings.py\", line 25, in <module>\n File \"/home/chiefir/lib/python3.5/site-packages/django/__init__.py\", line 22, in setup\n configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)\n
File \"/home/chiefir/lib/python3.5/site-packages/django/utils/log.py\", line 75, in configure_logging\n logging_config_func(logging_settings)\n File \"/usr/lib/python3.5/logging/config.py\", line 795, in dictConfig\n dictConfigClass(config).configure()\n
File \"/usr/lib/python3.5/logging/config.py\", line 566, in configure\n '%r: %s' % (name, e))\n
ValueError: Unable to configure handler 'file': [Errno 20] Not a directory: '/tmp/first_scrapy-1526919848-13w8cqlm.egg/debug.log'\n",
"status": "error"}
Строки 24 и 25 в first_scrapy.settings:
import django
django.setup()
Издесь my_project.settings.LOGGING
:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'WARNING',
'class': 'logging.FileHandler',
'filename': os.path.join(BASE_DIR, 'debug.log'),
},
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler'
},
},
'loggers': {
'django': {
'handlers': ['file'],
'level': 'WARNING',
'propagate': True,
},
},
}
И BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Поскольку я понимаю, что что-то не так в settings.LOGGING
, но я не могу понять, что.Вы можете мне помочь?
Это не дубликат.Это похожий вопрос, но у меня есть разные причины этой ошибки - я не создаю. Я проверил все, как показано на этом вопросе - и он работает на локальном сервере.