I have defined a django view that uses scipy.optimize.curve_fit
. This works without problems using the django development server, but when I deploy the Django application with Apache and mod_wsgi the view function gets stuck importing curve_fit:
我已经定义了一个使用scipy.optimize.curve_fit的django视图。使用django开发服务器时这没有问题,但是当我使用Apache和mod_wsgi部署Django应用程序时,视图函数会导致导入curve_fit:
from scipy.optimize import curve_fit
When this line is removed the rest of the app works well on the Apache server. Why does this line not work with Apache and mod_wsgi?
删除此行后,应用程序的其余部分在Apache服务器上运行良好。为什么这行不适用于Apache和mod_wsgi?
1 个解决方案
#1
8
In your WSGI file you will have something that looks like this:
在您的WSGI文件中,您将看到如下所示的内容:
<VirtualHost>
...
WSGIScriptAlias / /somepath/deployment/wsgi/yoursite.wsgi
</VirtualHost>
You need to add the following line:
您需要添加以下行:
<VirtualHost>
...
WSGIScriptAlias / /somepath/deployment/wsgi/yoursite.wsgi
WSGIApplicationGroup %{GLOBAL}
</VirtualHost>
The explanation for that can be found here:
对此的解释可以在这里找到:
http://mail.scipy.org/pipermail/scipy-user/2011-November/031014.html
http://mail.scipy.org/pipermail/scipy-user/2011-November/031014.html
#1
8
In your WSGI file you will have something that looks like this:
在您的WSGI文件中,您将看到如下所示的内容:
<VirtualHost>
...
WSGIScriptAlias / /somepath/deployment/wsgi/yoursite.wsgi
</VirtualHost>
You need to add the following line:
您需要添加以下行:
<VirtualHost>
...
WSGIScriptAlias / /somepath/deployment/wsgi/yoursite.wsgi
WSGIApplicationGroup %{GLOBAL}
</VirtualHost>
The explanation for that can be found here:
对此的解释可以在这里找到:
http://mail.scipy.org/pipermail/scipy-user/2011-November/031014.html
http://mail.scipy.org/pipermail/scipy-user/2011-November/031014.html