【发布时间】:2014-08-19 07:09:09
【问题描述】:
我正在尝试运行一个 Django 项目“strona”。 我确实在 ~/apps 中创建了一个文件夹结构,创建了符号链接并添加到 ~/apps 的 .httpd.conf 中:
SetHandler None
在我的 public_html 的 .httpd.conf 中:
SetHandler python-program
PythonHandler django.core.handlers.wsgi # also tried modpython modpython
SetEnv DJANGO_SETTINGS_MODULE strona.settings
PythonPath "['/usr/local/lib/python2.6', '/home/USERNAME/apps'] + sys.path"
PythonDebug On
#PythonDebug Off
在 error.log 中我得到这个:
[Date] [alert] [client [...]] /[...]/public_html/.htaccess: Invalid command 'PythonHandler', Perhaps misspelled or defined by a module not included in the server configuration
我有 Python 和 Djano,我可以导入 wsgi 模块。 为什么它不起作用?
【问题讨论】:
-
这是“Apache 端”的问题。见Why do I get error, Invalid command 'PythonHandler'?
-
谢谢,但我没有 /etc/apache2/mods 启用目录。事实上,我根本没有目录,只有 conf.d
标签: python django apache python-2.6