配置 uWSGI:
(venv)$ pip install uwsgi # 安装 uWSGI
Running with wsgi.py
file(wsgi.py
is the file name with app. callable):
(venv)$ uwsgi --socket 127.0.0.1:8080 --protocol=http -w wsgi
Runing under virtualenv, -H
to set virtualenv to python path.
(venv)$ uwsgi --socket 127.0.0.1:8080 --protocol=http -H ./venv -w wsgi
Supplying the pidfile
option
(venv)$ uwsgi ..... --pidfile=/tmp/uwsgi.pid
$ kill -HUP `cat /tmp/uwsgi.pid` # using kill to send the signal, gracefully reload all the workers and the master process
$ kill -INT `cat /tmp/uwsgi.pid` # immediately kill the entire uWSGI stack
(venv)$ uwsgi --reload /tmp/uwsgi.pid # or the convenience option --reload
Remember that you can only reload uWSGI when it’s running with the master process
mode, but that’s usually the case though.
(venv)$ uwsgi ..... --master # enable master process
Ref: