我花了几天时间尝试在Windows 8.1上设置django Web服务器。一切都已正确安装。 wsgi
具有正确的版本,具有更新的apache Windows和Python 3.6,当我尝试访问apache日志时,它向我显示此错误:
[Tue Feb 19 15:40:53.622597 2019] [wsgi:error] [pid 4716:tid 1104] [client 192.168.1.229:50746] mod_wsgi (pid=4716): Failed to exec Python script file 'C:/uno/proyecto/proyecto/wsgi.py'.
[Tue Feb 19 15:40:53.622597 2019] [wsgi:error] [pid 4716:tid 1104] [client 192.168.1.229:50746] mod_wsgi (pid=4716): Exception occurred processing WSGI script 'C:/uno/proyecto/proyecto/wsgi.py'.
[Tue Feb 19 15:40:53.623600 2019] [wsgi:error] [pid 4716:tid 1104] [client 192.168.1.229:50746] Traceback (most recent call last):\r
[Tue Feb 19 15:40:53.623600 2019] [wsgi:error] [pid 4716:tid 1104] [client 192.168.1.229:50746] File "C:/uno/proyecto/proyecto/wsgi.py", line 12, in <module>\r
[Tue Feb 19 15:40:53.623600 2019] [wsgi:error] [pid 4716:tid 1104] [client 192.168.1.229:50746] from django.core.wsgi import get_wsgi_application\r
[Tue Feb 19 15:40:53.623600 2019] [wsgi:error] [pid 4716:tid 1104] [client 192.168.1.229:50746] ModuleNotFoundError: No module named 'django'\r
我的virtualenv称为uno,项目称为proyecto。我不知道为什么会这样。我有一台机器,并且在此配置下工作正常。
httpd.conf
LoadFile "c:/users/srv/appdata/local/programs/python/python36/python36.dll"
LoadModule wsgi_module "c:/users/srv/appdata/local/programs/python/python36/lib/site-packages/mod_wsgi/server/mod_wsgi.cp36-win_amd64.pyd"
WSGIPythonHome "c:/users/srv/appdata/local/programs/python/python36"
WSGIScriptAlias / "C:\uno\proyecto\proyecto\wsgi.py"
WSGIPythonPath "C:\uno\proyecto"
<Directory "C:\uno\proyecto">
<Files wsgi.py>
Require all granted
</Files>
</Directory>
有什么想法吗?