加载django模块WSGI时的Apache ImportError

时间:2011-07-25 21:08:28

标签: python django apache mod-wsgi

我正在关注mod_wsgi网站上的integration with django教程,并且在尝试加载我的网站时收到以下错误,我在上一个tutorial中的测试脚本正常工作。这是我的apache服务器的错误日志,我安装了django,我可以在运行python时导入它,所以我认为它必须是其他导致链接断开的原因。

[Mon Jul 25 20:44:14 2011] [error] [client 93.97.146.103] ImportError: No module named django.core.handlers.wsgi
[Mon Jul 25 20:44:15 2011] [error] [client 93.97.146.103] mod_wsgi (pid=1851): Target       WSGI script '/var/www/html/wsgi-scripts$
[Mon Jul 25 20:44:15 2011] [error] [client 93.97.146.103] mod_wsgi (pid=1851): Exception occurred processing WSGI script '/va$
[Mon Jul 25 20:44:15 2011] [error] [client 93.97.146.103] Traceback (most recent call last):
[Mon Jul 25 20:44:15 2011] [error] [client 93.97.146.103]   File "/var/www/html/wsgi-scripts/test.wsgi", line 10, in <module>
[Mon Jul 25 20:44:15 2011] [error] [client 93.97.146.103]     import django.core.handlers.wsgi
[Mon Jul 25 20:44:15 2011] [error] [client 93.97.146.103] ImportError: No module named django.core.handlers.wsgi
[Mon Jul 25 20:44:15 2011] [error] [client 93.97.146.103] mod_wsgi (pid=1853): Target WSGI script '/var/www/html/wsgi-scripts$
[Mon Jul 25 20:44:15 2011] [error] [client 93.97.146.103] mod_wsgi (pid=1853): Exception occurred processing WSGI script '/va$
[Mon Jul 25 20:44:15 2011] [error] [client 93.97.146.103] Traceback (most recent call last):
[Mon Jul 25 20:44:15 2011] [error] [client 93.97.146.103]   File "/var/www/html/wsgi-scripts/test.wsgi", line 10, in <module>
[Mon Jul 25 20:44:15 2011] [error] [client 93.97.146.103]     import django.core.handlers.wsgi
[Mon Jul 25 20:44:15 2011] [error] [client 93.97.146.103] ImportError: No module named django.core.handlers.wsgi

有没有人知道这是什么?我的httpd / apache配置目前只是基础,如第二篇教程中所强调的那样。

任何指示都将不胜感激,谢谢。

1 个答案:

答案 0 :(得分:2)

在建立mod_wsgi的Python版本下安装Django,或者为安装Django的Python版本构建mod_wsgi。