我安裝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