windows 下启动 Apache 后,打开 django 项目首页,一直进入“等待服务器响应”(注:centos7 + nginx + uwsgi 部署无此现象 ),之前项目是正常运行,最近项目导入 pandas 模块就这样,所以在网上搜资料,找到一篇现象一模一样的博客( Import Pandas on apache server causes timeout error ),遂试了一下,问题解决了。
只需要在 Apache 的 httpd.conf 中加入:
WSGIApplicationGroup %{GLOBAL}
# 解释
# Various of the scientific packages that it is going to need will not work in Python sub interpreters. That directive will force the use of the main interpreter context.