經過幾天的嘗試,我無法使用mod_wsgi部署我的django網站。有人能否理智地檢查這些細節,看看有什麼明顯的錯誤?這是我的第一個Django部署。它已運行文件與Python manage.py runserver 10.10.10.214:8080
,但我不能在/home/user/django/mysite
部署無法使用mod_wsgi&apache部署django
我wsgi.py
文件(也是在我的settings.py等都)
"""
WSGI config for myproject project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
我的Apache .conf文件:
LoadModule wsgi_module /home/conf/apache2/modules/mod_wsgi.so #dont read into the locations too much - they are correct
WSGIScriptAlias//home/user/django/mysite/wsgi.py
WSGIPythonPath /home/user/django
<Directory /home/user/django/mysite>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
我不得不使用一個預先定製好的apache版本,但是上面的conf文件包含在內。任何幫助都很好。
乾杯,亞瑟
我推薦使用nginx和uwsgi進行部署;)http://www.django-tips.com/tip/deploying-django-project-with-nginx-and-uwsgi/3/ – doniyor
apache錯誤日誌點你在任何方向。配置似乎乍一看 –
我可能只需要看看那個@ doniyor –