Django uwsgi nginx 配置
全部安装好之后
不用python manage.py runserver 而是用uwsgi uwsgi.ini命令, 其中uwsgi.ini是写的uwsgi配置文件,
[uwsgi] socket = 127.0.0.1:3031 chdir = /home/david/project wsgi-file = xxx/wsgi.py processes = 4 threads = 2 stats = 127.0.0.1:9191
然后nginx.conf中对应的转发的配置
server{ listen 8080; ................................此处省略 location / { include uwsgi_params; uwsgi_pass 127.0.0.1:3031; } }
想在后台不中断的运行,nohup uwsgi uwsgi.ini > /home/david/nohup.out 2>&1 &
- 简单配置差不多如上
现在在本机浏览器里访问http://localhost:8080/, OK
如果是用的virtualenv 配置的sample
1 [uwsgi] 2 socket = :2345 3 master = true 4 processes = 12 5 harakiri = 1800 6 #buffer-size = 32768 7 #post-buffering = true 8 #post-buffering-buffersize = 32768 9 max-requests = 500 10 gid=rit 11 uid=david 12 chdir = /david/clarity 13 module=clarity.wsgi:application 14 pp=/david/clarity 15 pp=/home/david/.env/clarity/lib/python2.6/site-packages/ #看这里 16 #pythonpath=/home/david/.env/clarity/bin/python 17 env=clarity.production 18 reload-on-as = 512 19 reload-on-rss = 192
相关推荐
岁月如歌 2020-07-27
lreis00 2020-06-29
89403969 2020-06-12
ZhaoMengjiao 2020-06-09
87193750 2020-05-30
咻咻ing 2020-05-17
eightbrother 2020-05-05
87254055 2020-04-14
ZhaoMengjiao 2020-03-28
ZhaoMengjiao 2020-03-08
89403969 2020-03-04
89403969 2020-03-04
87193750 2020-02-24
85407718 2020-02-09
eightbrother 2020-01-02
vanturman 2019-12-26
山顶冻人 2019-12-25
aolishuai 2019-12-13
89403969 2019-12-11