飓风过境 发表于 2014-06-04 12:58

还是Mod Python的问题!

1、环境是CentOS+Apache2.2.27+Python3.3+Django1.6+Mod_Python3.5,搭建完后,用了一个test的py文件测试了下,发现mod_python正常工作。
2、接着发现mod_python安装后/site-packages/django/core/handlers/目录下并没有modpython模块,而是在python3/lib/python3.3/site-packages/。也不知道是不是有问题    - -!,于是将模块拷贝过去,然后PythonShell能正常Import django.core.handlers.modpython
3、OK下一步,配置项目,项目在/tmp下,叫mysite,但是HTTPD配置好后:
<Location "/">
SetHandler python-program
PythonPath "sys.path+['/tmp']
PythonHandler django.core.handlers.modpython
PythonAutoReload Off
PythonDebug On
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
</Location>

报如下错误:
==================================================================================

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

File "/usr/local/python3/lib/python3.3/site-packages/mod_python/apache.py", line 368, in HandlerDispatch
    arg=req, silent=hlist.silent)

File "/usr/local/python3/lib/python3.3/site-packages/mod_python/apache.py", line 708, in resolve_object
    raise AttributeError(s)

AttributeError: module '/usr/local/python3/lib/python3.3/site-packages/django/core/handlers/modpython/__init__.py' contains no 'handler'
==================================================================================

这下怎么调试都调不好了....大家帮我看看问题在哪?感激不尽

baopbird2005 发表于 2014-06-05 10:29

http://blog.sina.com.cn/s/blog_978a39e401016a5w.html
看看这个兴许对你有帮助
页: [1]
查看完整版本: 还是Mod Python的问题!