From 272f9a0c7d0c09f0b7cb0a9cfd792639bf093390 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 11 Feb 2015 18:16:49 +0100 Subject: Add a sample Makefile --- Makefile.example | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Makefile.example (limited to 'Makefile.example') diff --git a/Makefile.example b/Makefile.example new file mode 100644 index 0000000..d11fc57 --- /dev/null +++ b/Makefile.example @@ -0,0 +1,41 @@ +SHELL := /bin/bash + +# if a virtualenv is used put the full python path +# e.g.: PYTHON=$$HOME/.virtualenvs/chimere/bin/python +PYTHON=python +# put name of your current project +project=chimere_example_project + +update: clean syncdb compilemessages + +clean: + -rm -rf *~* + -find . -name '*.pyc' -exec rm {} \; + -find . -name '.*.swp' -exec rm {} \; + +test: clean + cd $(project); $(PYTHON) manage.py test chimere + +pep8: + pep8 --filename=*.py --ignore=W --exclude="manage.py,settings.py,migrations" --statistics --repeat . + +pylint: + pylint "$(CURDIR)/chimere" --ignore=.git,migrations --max-public-methods=50 --ignored-classes=Item.Meta --method-rgx='[a-z_][a-z0-9_]{2,40}$$' + +fresh_syncdb: + cd $(project); $(PYTHON) ./manage.py syncdb --noinput 2> /dev/null > /dev/null + cd $(project); $(PYTHON) ./manage.py migrate chimere 2> /dev/null > /dev/null + +syncdb: + cd $(project); $(PYTHON) manage.py syncdb --noinput + cd $(project); $(PYTHON) manage.py migrate + +shell: + cd $(project);$(PYTHON) manage.py shell + +run: + cd $(project); $(PYTHON) manage.py runserver 0.0.0.0:8000 + +compilemessages: + cd $(CURDIR)/chimere; \ + $(PYTHON) ../$(project)/manage.py compilemessages -- cgit v1.2.3 From 87d832cae6f59e28b2ef2e15b7078ccc325fb0c4 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 11 Feb 2015 18:23:56 +0100 Subject: Makefile sample: add collecstatic to update --- Makefile.example | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Makefile.example') diff --git a/Makefile.example b/Makefile.example index d11fc57..e50bace 100644 --- a/Makefile.example +++ b/Makefile.example @@ -6,7 +6,7 @@ PYTHON=python # put name of your current project project=chimere_example_project -update: clean syncdb compilemessages +update: clean syncdb compilemessages collectstatic clean: -rm -rf *~* @@ -39,3 +39,7 @@ run: compilemessages: cd $(CURDIR)/chimere; \ $(PYTHON) ../$(project)/manage.py compilemessages + +collectstatic: + cd $(CURDIR)/chimere; \ + $(PYTHON) ../$(project)/manage.py collectstatic --noinput -- cgit v1.2.3