经过几天的尝试,我无法使用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 –