作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我在使用 Windows 的家用电脑上运行我的测试站点。现在,我正在尝试缩略图,但出现错误:
The _imaging C module is not installed
但仅当我尝试通过 Apache 服务器访问 View 时。运行服务器缩略图就好了。我已经安装了其他人引用的特殊预编译二进制文件,但没有任何运气。
知道为什么它可以在 runserver/shell 而不是 Apache 中运行吗?
最佳答案
您需要在 .wsgi 配置文件的路径中包含 PIL 和其他站点包的路径。所以首先你需要找到你的站点包的位置(例如:/usr/local/lib/python2.6/site-packages/),然后将它添加到你的 .wsgi 文件中的 sys.path。示例 WSGI:
import os, sys
sys.path.append('/home/www/sites/mysite', '/usr/local/lib/python2.6/site-packages/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
关于windows - 如何修复 "The _imaging C module is not installed"Django/WSGI/Apache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6397509/
我是一名优秀的程序员,十分优秀!