我試圖通過mod_python部署一個django項目,我不斷收到一個錯誤,指出處理程序模塊丟失。Django的mod_python部署錯誤
我的Apache配置:
<Location />
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE bookmarklet_server.settings
PythonOption django.root/
PythonDebug On
#PythonPath "['', '/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/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6', '/usr/lib/pymodules/python2.6/gtk-2.0', '/usr/local/lib/python2.6/dist-packages']"
</Location>
另一條道路是從我試圖剛剛超過默認PYTHONPATH複製,但它並沒有幫助。
在Python控制檯快速測試顯示模塊應入店:
的Python 2.6.4(r264:75706,2009年11月2日,14點44分17秒) [GCC 4.4.1] on linux2 輸入「help」,「copyright」,「credits」或「license」以獲取更多信息。
>>>進口django.core.handlers.modpython
沒有錯誤
但是加載該網站,則inadvertendly返回此錯誤:
MOD_PYTHON ERROR
ProcessId: 8926
Interpreter: '<ip>'
ServerName: '<ip>'
DocumentRoot: '/htdocs'
URI: '/'
Location: '/'
Directory: None
Filename: '/htdocs'
PathInfo: '/'
Phase: 'PythonHandler'
Handler: 'django.core.handlers.modpython'
Traceback (most recent call last):
File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1202, in _process_target
module = import_module(module_name, path=path)
File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 304, in import_module
return __import__(module_name, {}, {}, ['*'])
ImportError: No module named django.core.handlers.modpython
django中安裝了什麼路徑? Web服務器用戶可訪問嗎? – bobince 2009-12-12 11:33:38