The problem I encountered is my wsgi file, which cannot import wsgi handlers correctly.
/var/log/apache2/error.log reports:
ImportError: no module named django.core.handlers.wsgi
A Google search results in a couple of results, mainly related to permission errors, because www-datait cannot read certain files and / or the pythonpath is incorrect. Some of the solutions are vague or just do not work in my circumstances.
Background information ..
My / usr / lib directory ..
/usr/lib/python2.4
/usr/lib/python2.5
/usr/lib/python2.6
/usr/lib/python-django
The default python version is 2.5.2. If I open the interpreter as a regular user, I can import django.core.handlers.wsgino problem.
www-data, python , django.core.handlers.wsgi .
bashrc PYTHONPATH , django...
export PYTHONPATH=/home/meder/django-sites/:$PYTHONPATH
, :
django-sites/
test
test - , django-admin createproject.
:
<VirtualHost *:80>
ServerName beta.blah.com
WSGIScriptAlias / /home/meder/django-sites/test/apache/django.wsgi
Alias /media /home/meder/django-sites/test/media/
</VirtualHost>
/home/meder/django-sites/test/apache/django.wsgi:
import os, sys
sys.path.append('/usr/local/django')
sys.path.append('/home/meder/django-sites')
sys.path.append('/home/meder/django-sites/test')
os.environ['DJANGO_SETTINGS_MODULE'] = 'test.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
, - Debian Lenny, django 1.1.1 backports. , .
# 1 - ldd /usr/lib/apache2/modules/mod_wsgi.so:
meder@site:/usr/lib/apache2/modules$ ldd mod_wsgi.so
libpython2.5.so.1.0 => /usr/lib/libpython2.5.so.1.0 (0xb7d99000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb7d81000)
libdl.so.2 => /lib/libdl.so.2 (0xb7d7c000)
libutil.so.1 => /lib/libutil.so.1 (0xb7d78000)
libm.so.6 => /lib/libm.so.6 (0xb7d52000)
libc.so.6 => /lib/libc.so.6 (0xb7c14000)
/lib/ld-linux.so.2 (0xb7efd000)
python 2.5, 2.4.