fastdev-django / Makefile

# Just remember that you need to use real tabs, not spaces, in a Makefile

.PHONY: run
run: bin/django syncdb compile_trans
	./bin/django runserver 0.0.0.0:8000

.PHONY: run_prod
runprod: bin/django compile_trans
	./bin/prod runserver 0.0.0.0:8000  # replace this with more sensible (like "apache/bin/restart")

.PHONY: werkzeug
runserver_plus: bin/django syncdb
	./bin/django runserver_plus

.PHONY: shell_plus
shell_plus: bin/django syncdb
	./bin/django shell_plus

.PHONY: shell_plus_prod
shell_plus_prod: bin/django syncdb
	./bin/prod shell_plus

.PHONY: check_pyflakes
check_pyflakes: bin/pyflakes
	find . -name '*.py' -exec ./bin/pyflakes {} \;

.PHONY: check_pep8
check_pep8: bin/pep8
	find . -name '*.py' -exec ./bin/pep8 {} \;

bin/pep8: bin/buildout
	./bin/buildout install pep8

bin/django: bin/buildout buildout.cfg
	./bin/buildout && touch bin/django bin/prod

bin/buildout:
	python bootstrap.py --distribute

syncdb: bin/django
	./bin/django syncdb && touch syncdb

.PHONY: make_trans
make_trans: bin/django
	./bin/django makemessages -a -e 'py,html,haml'

buildout.cfg:

compile_trans:
	find locale/ -mindepth 1 -maxdepth 1 -type d -exec make {}/LC_MESSAGES/django.mo \;

locale/%/LC_MESSAGES/django.mo: locale/%/LC_MESSAGES/django.po bin/django
	./bin/django compilemessages -l $(word 2,$(subst /, ,$@))

locale/*/LC_MESSAGES/django.po:

# coffeescript dependency. Uncomment the following line to turn it on.
# requires curl
# Also set USE_COFFEE_SCRIPT=True in settings.py
#run: bin/coffee
bin/coffee: bin/buildout
	./bin/buildout install coffee

# rebuilds the database (useful for development environment)
.PHONY: rebuilddb
rebuilddb: bin/django
	bin/django reset_db --router=default --noinput
	bin/django syncdb --noinput
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.