我安装Django(1.11)和Python 3.5的virtualenv在我的CentOS的生产服务器(CentOS的6.5)的Django在Apache 2.2.15在CentOS 6.5
当我在本地使用python manage.py runserver命令,我可以使用Django的开始Django的,但我不能为我与国防部WSGI 阿帕奇的Django我测试非常差的配置上/conf.s/django.conf但我面临着这样的错误:
mod_wsgi (pid=5713): Target WSGI script '/var/www/path/to/site/myapp/wsgi.py' cannot be loaded as Python module.
这是我django.conf在/etc/httpd/conf.d/django.conf中
<VirtualHost *:80>
WSGIProcessGroup myapp
WSGIDaemonProcess myapp display-name=%{GROUP}
ServerName test.com
ServerAlias www.test.com
ServerAdmin [email protected]
DocumentRoot /path/to/root
WSGIScriptAlias//path/to/root/myapp/wsgi.py
Alias /static /path/to/root/myapp/static
ErrorLog /path/to/error.log
CustomLog /path/to/access.log combined </VirtualHost>
我该如何处理这个问题?
你是怎么安装mod-wsgi的?它必须针对某个Python版本进行编译。如果你安装yum,我猜你已经从yum得到了一个非常过时的Python 2版本。 – FlipperPA
是的,wsgi与yum一起安装,我如何编译python 3.5的wsgi? – Arash