Skip to content

Instantly share code, notes, and snippets.

@jarvys
Last active August 29, 2015 14:00
Show Gist options
  • Save jarvys/11248026 to your computer and use it in GitHub Desktop.
Save jarvys/11248026 to your computer and use it in GitHub Desktop.

#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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment