繁体   English   中英

Django的内部500错误:尝试设置mod_wsgi

[英]Internal 500 error with Django: trying to set up mod_wsgi

我使用django创建了一个网站,并尝试使用我的apache服务器设置mod_wsgi。

当我转到我的网站时,出现此错误:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

这是我尝试设置mod_wsgi时得到的错误日志文件

[Wed Jan 07 16:08:01 2015] [error] [client 108.200.246.4] mod_wsgi (pid=18513): Target WSGI script '/var/www/firstweb/firstweb/wsgi.py' cannot be loaded as Python module.
[Wed Jan 07 16:08:01 2015] [error] [client 108.200.246.4] mod_wsgi (pid=18513): Exception occurred processing WSGI script '/var/www/firstweb/firstweb/wsgi.py'.
[Wed Jan 07 16:08:01 2015] [error] [client 108.200.246.4] Traceback (most recent call last):
[Wed Jan 07 16:08:01 2015] [error] [client 108.200.246.4]   File "/var/www/firstweb/firstweb/wsgi.py", line 13, in <module>
[Wed Jan 07 16:08:01 2015] [error] [client 108.200.246.4]     from django.core.wsgi import get_wsgi_application
[Wed Jan 07 16:08:01 2015] [error] [client 108.200.246.4] ImportError: No module named django.core.wsgi

以下是我的httpd.conf文件:

WSGIScriptAlias /mahi/ /var/www/firstweb/firstweb/wsgi.py
WSGIPythonPath /var/www/firstweb/ 

<Directory "/var/www/firstweb/firstweb">
<Files wsgi.py>
    Order allow,deny
    Allow from all
</Files>

</Directory>

请帮我。 我没有方向去。

似乎python路径不完整。 如果您使用全局Python安装,在ubuntu中就是这样。

WSGIPythonPath /var/www/firstweb/:/usr/local/lib/python3.4/dist-packages

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM