J'essaie d'obtenir Django et Apache travailler ensemble en utilisant mod_wsgi et actuellement que je reçois les erreurs suivantes:Django et Apache Problème
[Thu Jul 15 12:52:38 2010] [error] [client 10.100.50.73] mod_wsgi (pid=4803): Target WSGI script '/home/webdev/websites/virtualenvs/polaris/polaris_project.py' cannot be loaded as Python module.
[Thu Jul 15 12:52:38 2010] [error] [client 10.100.50.73] mod_wsgi (pid=4803): Exception occurred processing WSGI script '/home/webdev/websites/virtualenvs/polaris/polaris_project.py'.
[Thu Jul 15 12:52:38 2010] [error] [client 10.100.50.73] Traceback (most recent call last):
[Thu Jul 15 12:52:38 2010] [error] [client 10.100.50.73] File "/home/webdev/websites/virtualenvs/polaris/polaris_project.py", line 8, in <module>
[Thu Jul 15 12:52:38 2010] [error] [client 10.100.50.73] import django.core.handlers.wsgi
[Thu Jul 15 12:52:38 2010] [error] [client 10.100.50.73] ImportError: No module named django.core.handlers.wsgi
Mon apache conf ressemble
Alias /polaris_django/media/ "/home/webdev/websites/virtualenvs/polaris/polaris/static/"
WSGIScriptAlias /polaris_django /home/webdev/websites/virtualenvs/polaris/polaris_project.py
WSGIApplicationGroup %{GLOBAL}
<Directory "/home/webdev/websites/virtualenvs/polaris">
Order deny,allow
Allow from all
</Directory>
Mon Le fichier Mod_WSGi ressemble à
import os, sys
sys.path.append('/home/webdev/websites/virtualenvs/polaris')
sys.path.append('/home/webdev/websites/virtualenvs/polaris/polaris/apps')
sys.path.append('/home/webdev/websites/virtualenvs/polaris/polaris/extra_settings')
os.environ['DJANGO_SETTINGS_MODULE'] = 'polaris.settings'
print >> sys.stderr, sys.path
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Comment puis-je obtenir Apache au service de Django correctement?
[. .. '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/ usr/lib/python2 .6/lib-old ',' /usr/lib/python2.6/lib-dynload ',' /usr/lib/python2.6/dist-packages ',' /usr/lib/pymodules/python2.6 ' '/usr/lib/pymodules/python2.6/gtk-2.0', '/usr/local/lib/python2.6/dist-packages', '/ home/webdev/websites/virtualenvs/polaris/pysrc/a pps ','/home/webdev/sites/virtualenvs/polaris/pysrc/extra_settings ','/home/webdev/sites/virtualenvs/polaris/pysrc '] – silent1mezzo
Aussi, si je fais python polaris.wsgi ça marche bien. J'ai aussi changé de polaris -> pysrc – silent1mezzo