Django中uwsgi部署

场景

django 部署 通过uwsgi配置文件部署

uwsgi.ini文件
[uwsgi]    #文件顶部必须要写,不然识别不到
http=:8084    # 设置监听端口
chdir=/dj/speakMovie   # 指定项目路径,只是到项目
uid=root
gid=root
module=speakMovie.wsgi:application    #固定写法项目名称.wsgi这种
master=true
workers=5
pidfile=/dj/speakMovie/speakMovie/uwsgi.pid 
vacuum=true
enable-threads=true
harakiri=30
post-buffering=2048
#daemonize=/dj/speakMovie/speakMovie/uwsgi.log

#home=/soft/Python-3.8.8/
PYTHONEHOME=/soft/Python-3.8.8/bin   #指定python环境

linux 配置
监听端口转发到指定项目地址:proxy_pass http://127.0.0.1:8084;

 server {
        listen       8083;
    #    listen       somename:8080;
         server_name  localhost;

        location / {
	     proxy_pass http://127.0.0.1:8084;
    #        root   html;
    #        index  index.html index.htm;
        }
    }
posted @ 2021-07-23 10:54  TestingShare  阅读(77)  评论(0编辑  收藏  举报