在apache2 下部署django 出现问题(使用conda虚拟环境)
使用python3, conf 如下
<VirtualHost *:5060>
ServerName localhost:5060
ServerAdmin Ysdd1@163.com
# WSGIPythonPath /home/yangtz/anaconda3/lib/python3.6/site-packages
WSGIDaemonProcess 192.168.100.18 python-path=/data2/serverend/dpsplat python-home=/home/yangtz/anaconda3/envs/keshihua/lib/python3.6/site-packages
WSGIProcessGroup 192.168.100.18
WSGIScriptAlias / /data2/serverend/dpsplat/visualplat/wsgi.py
<Directory /data2/serverend/dpsplat/visualplat>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error-dpsplat.log
CustomLog ${APACHE_LOG_DIR}/access-dpsplat.log combined
</VirtualHost>
django项目所需的环境在conda的虚拟环境中,命名为keshihua
mod_wsgi.so 已经load了,确认是python3的
apache2正常启动,但是链接没反应,错误日志如下:
[Wed Aug 02 13:31:51.550060 2017] [wsgi:error] [pid 27945:tid 140279756412672] [remote 192.168.100.20:43891] mod_wsgi (pid=27945): Target WSGI script '/data2/serverend/dpsplat/visualplat/wsgi.py' cannot be loaded as Python module.
[Wed Aug 02 13:31:51.550132 2017] [wsgi:error] [pid 27945:tid 140279756412672] [remote 192.168.100.20:43891] mod_wsgi (pid=27945): Exception occurred processing WSGI script '/data2/serverend/dpsplat/visualplat/wsgi.py'.
[Wed Aug 02 13:31:51.550799 2017] [wsgi:error] [pid 27945:tid 140279756412672] [remote 192.168.100.20:43891] Traceback (most recent call last):
[Wed Aug 02 13:31:51.550837 2017] [wsgi:error] [pid 27945:tid 140279756412672] [remote 192.168.100.20:43891] File "/data2/serverend/dpsplat/visualplat/wsgi.py", line 13, in <module>
[Wed Aug 02 13:31:51.550844 2017] [wsgi:error] [pid 27945:tid 140279756412672] [remote 192.168.100.20:43891] from django.core.wsgi import get_wsgi_application
[Wed Aug 02 13:31:51.550867 2017] [wsgi:error] [pid 27945:tid 140279756412672] [remote 192.168.100.20:43891] ImportError: No module named 'django'
[Wed Aug 02 13:31:52.549949 2017] [wsgi:error] [pid 27945:tid 140279638914816] [remote 192.168.100.20:43379] mod_wsgi (pid=27945): Target WSGI script '/data2/serverend/dpsplat/visualplat/wsgi.py' cannot be loaded as Python module.
[Wed Aug 02 13:31:52.550040 2017] [wsgi:error] [pid 27945:tid 140279638914816] [remote 192.168.100.20:43379] mod_wsgi (pid=27945): Exception occurred processing WSGI script '/data2/serverend/dpsplat/visualplat/wsgi.py'.
[Wed Aug 02 13:31:52.550199 2017] [wsgi:error] [pid 27945:tid 140279638914816] [remote 192.168.100.20:43379] Traceback (most recent call last):
[Wed Aug 02 13:31:52.550243 2017] [wsgi:error] [pid 27945:tid 140279638914816] [remote 192.168.100.20:43379] File "/data2/serverend/dpsplat/visualplat/wsgi.py", line 13, in <module>
[Wed Aug 02 13:31:52.550252 2017] [wsgi:error] [pid 27945:tid 140279638914816] [remote 192.168.100.20:43379] from django.core.wsgi import get_wsgi_application
[Wed Aug 02 13:31:52.550285 2017] [wsgi:error] [pid 27945:tid 140279638914816] [remote 192.168.100.20:43379] ImportError: No module named 'django'
这是怎么回事?我明明在conf里指定conda 环境了啊!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ImportError: No module named 'django'问题不是很明显么?