操作系统:MacOS; python版本:2.7; Django版本:1.11; Apache版本:2.45; mod_wsgi版本:4.x;

在mac上自带的apache的配置文件/ect/apache2/httpd.conf中添加: LoadModule wsgi_module /usr/local/httpd/modules/

WSGIScriptAlias / MySite/exercise1/mysite/ WSGIPythonPath /MySite/exercise1:/Users/xiongchunyang/Desktop/Django/exercise/env/lib/python3.6/site-packages

<directory mysite="" exercise1="" mysite=""> <files""> Require all granted </files> </directory>

然后打开localhost报错: Internal Server Error

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

Please contact the server administrator at to inform them of the time this error occurred, and the actions you performed just before this error.

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


  • 1 条回复 | 1 人参与
  • httpd.conf配置了项目根目录,在不添加以上代码时,运行localhost是正常的。

登录 或者 注册 后发表回复