Skip to main content
 首页 » 编程设计

python之生产服务器上的 django (ubuntu)

2025年05月04日30落叶无声

我正在尝试将我的 Web 应用程序发送到生产服务器。按照本教程 http://ijcdigital.com/blog/django-gunicorn-and-nginx-setup/,我的设置是 django-gunicorn-nginx .为了检查目的,我还没有安装主管。完美的配置设置没有问题,我得到了 Django 欢迎页面。然后我将我的应用程序加载到项目中。然后我运行 gunicorn_django --bind=127.0.0.1:8001 它显示

cover.backgroundmodel: "background": To use ImageFields, you need to install the Python Imaging Library. Get it at http://www.pythonware.com/products/pil/ . 
cover.backgroundmodel: "tmpbg": To use ImageFields, you need to install the Python Imaging Library. Get it at http://www.pythonware.com/products/pil/ . 
2012-05-22 14:24:02 [15359] [INFO] Worker exiting (pid: 15359) 
2012-05-23 00:54:02 [15360] [INFO] Booting worker with pid: 15360 
2012-05-22 14:24:02 [15360] [INFO] Worker exiting (pid: 15360) 
2012-05-23 00:54:02 [15349] [INFO] Handling signal: int 
2012-05-23 00:54:02 [15349] [INFO] Shutting down: Master 

但我已经成功安装了所有内容,包括 PIL 和其他图像库。有趣的是我正在让我的项目在我的电脑上完美运行。但是我无法确定生产服务器中问题的原因。

我再次尝试安装 pip install PIL 它显示如下 https://gist.github.com/2771119为什么会这样?为什么我现在不能安装我之前在安装 django 时成功安装的 PIL。

谁能帮帮我?谢谢!

请您参考如下方法:

安装 python-dev打包,因为你没有python的头文件来编译PIL。