Ich habe django mit mod_python eine Weile jetzt laufen musste aber heute bekomme ich folgende FehlerDjango Mod_python ERROR
MOD_PYTHON ERROR
ProcessId: 4551
Interpreter: 'thatch'
ServerName: 'thatch'
DocumentRoot: '/var/www/thatch'
URI: '/'
Location: '/'
Directory: None
Filename: '/var/www/thatch/'
PathInfo: ''
Phase: 'PythonHandler'
Handler: 'django.core.handlers.modpython'
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1202, in _process_target
module = import_module(module_name, path=path)
File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 304, in import_module
return __import__(module_name, {}, {}, ['*'])
ImportError: No module named django.core.handlers.modpython
Dies ist meine virtuelle Hostkonfiguration
<VirtualHost *:80>
ServerName thatch
DocumentRoot /var/www/thatch
<Location "/">
SetHandler python-program
PythonPath "['/var/www/thatch'] + sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE thatch.settings
PythonOption django.root /var/www/thatch
PythonDebug On
</Location>
<Location "/media">
SetHandler None
</Location>
<LocationMatch "\.(jpg|gif|png|css|js)$">
SetHandler None
</LocationMatch>
</VirtualHost>
Irgendwelche Ideen, warum dies geschieht?
Können Sie django.core importieren. handlers.modpython manuell von einer Python-Shell? Ich bin auf seltsame Importprobleme wie diese gestoßen, wenn ein Teil meines Python-Moduls nicht importiert werden kann, aber ich bekomme oft beschreibende Fehler, wenn ich versuche, manuell zu importieren. –
Ja, ich kann es direkt aus der Shell importieren –
Ok, was ist dann mit Ihrem Python-Pfad in Apache? Es könnte sein, dass es sich von Ihrem systemweiten Pfad geändert hat. Um es zu testen, könnten Sie versuchen, den Pfad für Django explizit mit PythonPath hinzuzufügen. –