J'ai eu django courir avec mod_python pendant un certain temps maintenant, mais aujourd'hui, je l'erreur suivanteDjango Mod_python erreur
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
Ceci est ma configuration d'hôte virtuel
<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>
Toutes les idées pourquoi cela se passe?
Pouvez-vous importer django.core. handlers.modpython manuellement à partir d'un shell python? J'ai rencontré des problèmes d'importation étranges comme ceci quand une partie de mon module de python ne peut pas importer, mais j'obtiens souvent plus d'erreurs descriptives en essayant d'importer manuellement. –
oui je peux l'importer directement à partir du shell –
Ok, alors qu'en est-il de votre chemin Python dans Apache? Il se peut que cela ait changé de votre chemin système. Pour le tester, vous pouvez essayer d'ajouter explicitement le chemin de Django en utilisant PythonPath. –