Django 在WSGIPythonPath上丢失了一个参数,Python模块搜索路径
如果我问了一个很愚蠢的问题,我很抱歉 但是我不知道我在做什么,我只是按照教程做 链接此处: 现在我正试图启动Apache服务器,在产品中运行我的Django代码 我遇到这个错误:Django 在WSGIPythonPath上丢失了一个参数,Python模块搜索路径,django,apache,mod-wsgi,Django,Apache,Mod Wsgi,如果我问了一个很愚蠢的问题,我很抱歉 但是我不知道我在做什么,我只是按照教程做 链接此处: 现在我正试图启动Apache服务器,在产品中运行我的Django代码 我遇到这个错误: C:\WINDOWS\system32>C:/Frontier_Website/Apache24/bin/httpd.exe -k startserver AH00526: Syntax error on line 542 of C:/Frontier_Website/Apache24/conf/httpd.co
C:\WINDOWS\system32>C:/Frontier_Website/Apache24/bin/httpd.exe -k startserver
AH00526: Syntax error on line 542 of C:/Frontier_Website/Apache24/conf/httpd.conf:
WSGIPythonPath takes one argument, Python module search path.
我假设这个错误无法找到我的python路径,这与python有关,这表示我不确定要查找什么
以下是httpd设置中的代码:
#python and mod_wsgi setting
LoadModule wsgi_module "c:/users/user/appdata/local/programs/python/python37/lib/site-packages/mod_wsgi/server/mod_wsgi.cp37-win_amd64.pyd"
WSGIScriptAlias / "C:\Frontier_Website\FrounterWeb postgreDB-the secnond\FrounterWeb\wsgi.py"
WSGIPythonHome C:/users/user/appdata/local/programs/python/python37
WSGIPythonPath C:\Frontier_Website\FrounterWeb postgreDB-the secnond\zigview
<Directory C:\Frontier_Website\FrounterWeb postgreDB-the secnond\zigview\static>
Require all granted
</Directory>
<Directory C:\Frontier_Website\FrounterWeb postgreDB-the secnond\zigview>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
#python和mod#wsgi设置
LoadModule wsgi_module“c:/users/user/appdata/local/programs/python37/lib/site packages/mod_wsgi/server/mod_wsgi.cp37-win_amd64.pyd”
WSGIScriptAlias/“C:\Frontier\u网站\fRunterWeb postgreDB secnond\fRunterWeb\wsgi.py”
WSGIPythonHome C:/users/user/appdata/local/programs/python/python37
WSGIPythonPath C:\Frontier\u网站\fRunterWeb postgreDB第二页\zigview
要求所有授权
要求所有授权
提前感谢您,非常感谢您的帮助在Apache中使用此模板创建django应用程序:
<VirtualHost *:80>
. . .
Alias /static /home/user/myproject/static
<Directory /home/user/myproject/static>
Require all granted
</Directory>
<Directory /home/user/myproject/myproject>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess myproject python-path=/home/user/myproject python-home=/home/user/myproject/myprojectenv
WSGIProcessGroup myproject
WSGIScriptAlias / /home/user/myproject/myproject/wsgi.py
</VirtualHost>
. . .
别名/static/home/user/myproject/static
要求所有授权
要求所有授权
WSGIDaemonProcess myproject python path=/home/user/myproject python home=/home/user/myproject/myprojectenv
WSGIProcessGroup myproject
WSGIScriptAlias//home/user/myproject/myproject/wsgi.py
WSGIPythonPath是用于搜索Python模块的附加目录,我想,如果使用虚拟环境,则不必这样做
来源:(apache配置也在Windows中工作)系统找不到指定的路径。我激活了虚拟环境并在cmd中运行它;Apache24\bin\httpd.ex-k启动