我正在将Django从1.4升级到1.7,这意味着我也要从Python 2.6.6迁移到Python 2.7。生产服务器使用Debian 6.09,在该系统中全局需要python 2.6,但很遗憾在此时升级操作系统不是一个可行的解决方案。为了解决这个问题,我安装了以下软件栈:
- pyenv和Python 2.7 - virtualenv - virtualenvwrapper - uwsgi - supervisor(从全局python 2.6安装,作为root运行) - nginx
当我手动从virtualenv运行uwsgi时,网站运行良好。然而,当我使用supervisor启动uwsgi时,它只会使用全局python安装。
- pyenv和Python 2.7 - virtualenv - virtualenvwrapper - uwsgi - supervisor(从全局python 2.6安装,作为root运行) - nginx
当我手动从virtualenv运行uwsgi时,网站运行良好。然而,当我使用supervisor启动uwsgi时,它只会使用全局python安装。
(django1.7)user@staging:~$ echo $PATH
/home/user/.virtualenvs/django1.7/bin:/home/user/.pyenv/shims:/home/user/.pyenv/bin:/usr/local/bin:/usr/bin:/bin
我的主管配置文件:
[program:app]
command = /home/user/.virtualenvs/django1.7/bin/uwsgi
--module app.wsgi
--socket 127.0.0.1:10001
--master
--harakiri 120
--max-requests 5000
--threads 6
directory=/home/user/app/
environment=PATH="/home/user/.virtualenvs/django1.7/bin:/home/user/.pyenv/shims:/home/user/.pyenv/bin:",DJANGO_SETTINGS_MODULE="app.settings",HOME="/home/user"
user=user
autostart=true
autorestart=true
redirect_stderr=true
stopsignal=QUIT
有人能帮忙指出我的配置有什么问题吗?
谢谢!