当我尝试遵循以下说明时 the official mod_wsgi page要在端口80上运行django站点,运行以下命令时出现错误:
python manage.py runmodwsgi --setup-only --port=80 --user www-data --group www-data
Successfully ran command.
Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/home/pi/.local/share/virtualenvs/KVK-sOswPsfs/lib/python3.5/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/home/pi/.local/share/virtualenvs/KVK-sOswPsfs/lib/python3.5/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/pi/.local/share/virtualenvs/KVK-sOswPsfs/lib/python3.5/site-packages/django/core/management/base.py", line 316, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/pi/.local/share/virtualenvs/KVK-sOswPsfs/lib/python3.5/site-packages/django/core/management/base.py", line 353, in execute
output = self.handle(*args, **options)
File "/home/pi/.local/share/virtualenvs/KVK-sOswPsfs/lib/python3.5/site-packages/mod_wsgi/server/management/commands/runmodwsgi.py", line 134, in handle
'start-server', args, options)
File "/home/pi/.local/share/virtualenvs/KVK-sOswPsfs/lib/python3.5/site-packages/mod_wsgi/server/__init__.py", line 3305, in _cmd_setup_server
generate_wsgi_handler_script(options)
File "/home/pi/.local/share/virtualenvs/KVK-sOswPsfs/lib/python3.5/site-packages/mod_wsgi/server/__init__.py", line 1711, in generate_wsgi_handler_script
with open(path, 'w') as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/etc/mod_wsgi-express-80/handler.wsgi'
但是命令python manage.py runmodwsgi
可以工作。它正确显示了网站的端口8000。因此,我认为这意味着一切正常,但是由于某种原因,它没有使用端口80的正确文件。
该系统是运行树莓派的Raspberry Pi 3。 python代码可以在我的github页面上找到:https://github.com/midasgossye/KVK/tree/working
任何线索都将非常有帮助:)