Source

djangotemplate_dec / Makefile

Full commit
# makefile for modern ubuntu systems django quicksetup
# note: makefiles use tabs not softtabs (press ctrl-v before tabbing in vim with softabs)

.PHONY: help install deploy quickdeploy htmldocs update clean

help:
	@echo "Please use \`make <target>' where <target> is one of"
	@echo "  install        install new virtualenv"
	@echo "  ffmpeg         install ffmpeg + codecs"
	@echo "  postgis        install postgis 1.5, postgres 9"
	@echo "  update         update existing virtualenv"
	@echo "  clean          remove existing virtualenv and docs"

install:
	mkdir -p virtualenv/.pipcache
	pip install -E virtualenv -r requirements.txt --download-cache="virtualenv/.pipcache"
	./manage.py createcachetable django_cache && ./manage.py syncdb --migrate; return 0

deploy:
	make install
	sudo ./manage.py createapacheconf /etc/apache2/conf.d
	make htmldocs
	make quickdeploy
	sudo service apache2 restart

quickdeploy:
	sudo ./manage.py collectstatic --noinput -l
	sudo chown -RL :www-data media/; return 0
	sudo chmod -R a=rX /var/www/django_static/
	sudo chmod -R a=rwX media/; return 0
	sudo chmod -R o+w /var/www/django_static/

htmldocs:
	mkdir docs; rm -r docs && mkdir docs
	find -name \*.py | grep -v "virtualenv/" > docs/sources.txt
	virtualenv/bin/pycco `cat docs/sources.txt` -d docs -p
	for i in `find docs -type d`; do cp docs/pycco.css $$i; done

update:
	pip install -E virtualenv -Ur requirements.txt --download-cache="virtualenv/.pipcache"

clean:
	sudo chmod +w virtualenv
	rm -rf virtualenv/*