0
我想让Django与使用WSGI的Apache一起工作。问题是它只是返回一个空白页面(200 OK或203未修改)。Django/WSGI空白页
重新启动或在error.log或django-error.log中访问页面时,我找不到任何错误。尽管在django-access.log中有一个条目。
WSGIPythonPath /web/django/dtest/
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /web/django
ServerName django.markv.nl
<Directory />
Options FollowSymLinks Includes
AllowOverride All
</Directory>
WSGIScriptAlias /wsgi-scripts/ /web/django/dtest/dtest/wsgi.py
LogLevel info
ErrorLog ${APACHE_LOG_DIR}/django-error.log
CustomLog ${APACHE_LOG_DIR}/django-access.log common
</VirtualHost>
- 我尝试使用
manage.py runserver
,在这种情况下它工作得很好,所以这真是一个阿帕奇/ WSGI问题。 - 我试图禁用mod_php5没有结果(PHP停止工作除外)。
任何线索什么问题或者我可以找到一个错误?这可能是一些微不足道的东西,但我找不到它...
即使我因为静态文件而遇到过这样的问题。 你的项目是否有静态文件?如果是这样,你必须看看如何[部署静态文件](https://docs.djangoproject.com/en/1.5/howto/static-files/deployment/)。 – Vishnu667
不是它会成为问题的原因,通常在子URL的URL挂载点上有一个尾部的斜杠。也就是说,使用'/ wsgi-scripts'而不是'/ wsgi-scripts /'。另外,Apache甚至被允许访问/ web/django/dtest/dtest中的文件?建议VirtualHost甚至没有被使用。回去阅读关于mod_wsgi部署的Django文档。 –