#Makefile
PORT:=9000
PROJECT:=project
start-uwsgi:
uwsgi --socket 127.0.0.1:$(PORT) \
--chdir $(shell pwd) \
--wsgi-file $(PROJECT)/wsgi.py \
--master \
--process 4 \
--threads 2 \
--daemonize $(shell pwd)/logs/uwsgi.log \
--pidfile $(shell pwd)/uwsgi.pid
reload-uwsgi:
uwsgi --reload uwsgi.pid
stop-uwsgi:
uwsgi --stop uwsgi.pid
find-port:
sudo netstat -nltp | grep $(PORT)
.PHONY: start-uwsgi stop-uwsgi reload-uwsgi find-port
#usage
$ make start-uwsgi # PORT=12580
$ make stop-uwsgi
$ make reload-uwsgi
#uwsgi docs click here