【发布时间】:2011-12-20 03:43:23
【问题描述】:
我在使用 mod_wsgi 在 apache2 中部署 django 时遇到此错误消息,我无法修复它:
tail -f /var/log/apache2/error.log
[Tue Dec 20 04:15:45 2011] [info] mod_wsgi (pid=3959): Adding '/usr/local/lib/python2.7/site-packages/' to path.
[Tue Dec 20 04:15:45 2011] [info] [client 80.226.1.7] mod_wsgi (pid=3959, process='', application='digitalchaot.de|/djangu'): Loading WSGI script '/home/webapps/digitalchaot/apache.wsgi'.
[Tue Dec 20 04:16:04 2011] [error] [client 80.226.1.7] mod_wsgi (pid=3959): Exception occurred processing WSGI script '/home/webapps/digitalchaot/apache.wsgi'.
[Tue Dec 20 04:16:04 2011] [error] [client 80.226.1.7] Traceback (most recent call last):
[Tue Dec 20 04:16:04 2011] [error] [client 80.226.1.7] File "/usr/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 284, in __call__
[Tue Dec 20 04:16:04 2011] [error] [client 80.226.1.7] start_response(status, response_headers)
[Tue Dec 20 04:16:04 2011] [error] [client 80.226.1.7] TypeError: expected byte string object for status, value of type str found
[Tue Dec 20 04:16:04 2011] [error] [client 80.226.1.7] File does not exist: /htdocs
[Tue Dec 20 04:20:11 2011] [error] [client 207.46.13.206] File does not exist: /htdocs
[Tue Dec 20 04:20:57 2011] [error] [client 207.46.13.206] File does not exist: /htdocs
我正在使用 Python 2.7.2 和 Django 1.3.1 和当前的 mod_wsgi 运行 Debian。由于之前的错误,我自己编译了 python、django 和 wsgi。有没有人提示错误可能是什么?
【问题讨论】:
-
您能否也发布您网站的 apache 配置?
-
提示可能是在您的 apache 配置中的某处,您将 /htdocs 称为静态内容的位置,而该位置不存在?
标签: python django apache2 mod-wsgi wsgi