nginx+uwsgi部署django应用

0.安装uwsgi

pip install uwsgi

1.配置uwsgi

这里写到ini文件里面去。

[uwsgi]
chdir=/opt/zm_cmdb/zm_cmdb
module=zm_cmdb.wsgi:application
master=True
pidfile=/tmp/project-master.pid
vacuum=True
max-requests=5000
daemonize=/tmp/zm_cmdb.log
socket=/tmp/uwsgi.sock

2.nginx配置

server {
  listen 80;
  server_name localhost;
  access_log /var/log/aca/access_log;
  access_log /var/log/aca/error_log;

    location /static/ {
        alias   /opt/zm_cmdb/zm_cmdb/static/;
    }

  location / {
    uwsgi_pass  unix:/tmp/uwsgi.sock;
    include uwsgi_params;
  }
}
阅读更多
个人分类: nginx django
上一篇django static + apache mod_wsgi部署
下一篇django 发送邮件
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭