Reputation: 2589
I'm running into this error message while deploying django in apache2 using mod_wsgi and i cannot fix it:
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
I'm running Debian with Python 2.7.2 with Django 1.3.1 and the current mod_wsgi. I compiled python, django and wsgi myself due to previous errors. Does anybody have a hint what the error might be ?
Upvotes: 0
Views: 685
Reputation: 58563
For the Python error, it looks like your mod_wsgi is compiled against Python 3.1 and not Python 2.7. You need to ensure that mod_wsgi which is installed was compiled against Python 2.7.
The clue is that error message is complaining that status is a byte string instead of text string. This can only occur in Python 3.X with mod_wsgi.
Go through the checks in this document:
http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation
Upvotes: 2