刚学Django不久,尝试把Django-cms部署到Apache下,配置文件如下
运行后页面中报错,
AttributeError: module ..............__init__.pyc contains no 'handler'
最终原因出在PythonHandler mysite 这句话上,这句话的意思将所有.py的请求都交给mysite.py来做处理,所以当你访问http://URL/index.py的时候,mod_python会寻找mysite.py来处理你的handler,而你的目录中并不存在mysite.py,导致报错.
<Location "/mysite/">
setHandler python-program
PythonPath "['E:/workarea/python','E:/workarea/python/mysite'] + sys.path"
PythonHandler django.core.handlers.modpython
PythonOption django.root /mysite
PythonHandler mysite
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonDebug On
</Location>
运行后页面中报错,
AttributeError: module ..............__init__.pyc contains no 'handler'
最终原因出在PythonHandler mysite 这句话上,这句话的意思将所有.py的请求都交给mysite.py来做处理,所以当你访问http://URL/index.py的时候,mod_python会寻找mysite.py来处理你的handler,而你的目录中并不存在mysite.py,导致报错.