Skip to content

Instantly share code, notes, and snippets.

@jarvys
Last active September 21, 2015 09:08
Show Gist options
  • Save jarvys/b3d715d63f794e8f745c to your computer and use it in GitHub Desktop.
Save jarvys/b3d715d63f794e8f745c to your computer and use it in GitHub Desktop.
my makefile for django project
host:=0.0.0.0
port:=8000
activate_venv=source venv/bin/activate
debug:
./manage.py runserver $(host):$(port)
start-uwsgi:
$(activate_venv) \
&& uwsgi --socket 127.0.0.1:$(port) \
--chdir $(shell pwd) \
--wsgi-file $(shell basename `pwd`)/wsgi.py \
--master \
--process 4 \
--daemonize $(shell pwd)/logs/uwsgi.log \
--pidfile $(shell pwd)/uwsgi.pid
stop-uwsgi:
$(activate_venv) && uwsgi --stop uwsgi.pid
reload-uwsgi:
$(activate_venv) && uwsgi --reload uwsgi.pid
collectstatic:
$(activate_venv) \
&& ./manage.py collectstatic --noinput
.PHONY: debug \
collectstatic \
reload-uwsgi \
start-uwsgi \
stop-uwsgi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment