python-Django与Nginx整合gunicorn模块

1.pip install gunicorn

2.修改Nginx配置文件

vim /etc/nginx/conf.d/virtual.conf

 1 server {
 2     listen       192.168.1.120:8000;
 3     #listen       somename:8080;
 4     server_name   localhost;
 5 
 6     location static/admin/ {
 7         root   /usr/lib/python2.6/site-packages/django/contrib/admin;
 8         index  index.html index.htm;
 9     }
10     location / {
11         proxy_pass     http://localhost:8000;
12     }
13 }

cd /usr/local/test/Python-Test/Django_test/simplecmdb_mysql_pickle

gunicorn simplecmdb.wsgi:application -D

posted @ 2016-07-28 09:00  Nyan  阅读(237)  评论(0编辑  收藏  举报