在win下使用xampp,并且安装了mod_python,然后使用flask给的例子,使用以下方法调用函数。
def handler(req):
req.content_type='text/plain'
init_db()
app.run()
return apache.OK
apache的http.conf加入了以下代码
AllowOverride FileInfo
SetHandler python-program
AddHandler mod_python .py
PythonAutoReload On
PythonHandler flaskr
PythonDebug On
然后访问localhost/python/flaskr报错
MOD_PYTHON ERROR
ProcessId: 9880
Interpreter: 'localhost'
ServerName: 'localhost'
DocumentRoot: 'D:/xampp/htdocs'
URI: '/python/flaskr/'
Location: None
Directory: 'D:/xampp/htdocs/python/flaskr/'
Filename: 'D:/xampp/htdocs/python/flaskr/'
PathInfo: ''
Phase: 'PythonHandler'
Handler: 'flaskr'
Tracebac