You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
2.2 KiB
65 lines
2.2 KiB
.PHONY: requirements requirements-upgrade freeze syncdb run run-public makemessages compilemessages collectstatic cloc clean user south
|
|
|
|
project_name=proj
|
|
|
|
requirements:
|
|
-@echo "### Installing requirements"
|
|
-@pip install -r requirements.txt
|
|
|
|
requirements-upgrade:
|
|
-@echo "### Upgrading requirements"
|
|
-@pip freeze | cut -d = -f 1 | xargs pip install -U
|
|
|
|
freeze:
|
|
-@echo "### Freezing python packages to requirements.txt"
|
|
-@pip freeze > requirements.txt
|
|
|
|
syncdb:
|
|
-@echo "### Creating database tables and loading fixtures"
|
|
@PYTHONPATH=$(PYTHONPATH):. DJANGO_SETTINGS_MODULE=$(project_name).settings ipython manage.py syncdb --noinput
|
|
@PYTHONPATH=$(PYTHONPATH):. DJANGO_SETTINGS_MODULE=$(project_name).settings ipython manage.py migrate
|
|
|
|
run:
|
|
@PYTHONPATH=$(PYTHONPATH):. DJANGO_SETTINGS_MODULE=$(project_name).settings ipython manage.py runserver
|
|
|
|
run-public:
|
|
@PYTHONPATH=$(PYTHONPATH):. DJANGO_SETTINGS_MODULE=$(project_name).settings ipython manage.py runserver 0.0.0.0:8000
|
|
|
|
shell:
|
|
@PYTHONPATH=$(PYTHONPATH):. DJANGO_SETTINGS_MODULE=$(project_name).settings python manage.py shell
|
|
|
|
makemessages:
|
|
-@ipython manage.py makemessages --all
|
|
|
|
compilemessages:
|
|
-@ipython manage.py compilemessages
|
|
|
|
collectstatic:
|
|
@ipython manage.py collectstatic
|
|
|
|
user:
|
|
-@ipython manage.py createsuperuser
|
|
|
|
# If the first argument is "south"...
|
|
ifeq (south,$(firstword $(MAKECMDGOALS)))
|
|
# use the rest as arguments for "south"
|
|
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
|
|
# ...and turn them into do-nothing targets
|
|
$(eval $(RUN_ARGS):;@:)
|
|
endif
|
|
south:
|
|
-@python manage.py schemamigration $(RUN_ARGS) --auto
|
|
-@python manage.py migrate $(RUN_ARGS)
|
|
|
|
cloc:
|
|
-@echo "### Counting lines of code within the project"
|
|
-@echo "# Total:" ; find . -iregex '.*\.py\|.*\.js\|.*\.html\|.*\.css' -type f -exec cat {} + | wc -l
|
|
-@echo "# Python:" ; find . -name '*.py' -type f -exec cat {} + | wc -l
|
|
-@echo "# JavaScript:" ; find . -name '*.js' -type f -exec cat {} + | wc -l
|
|
-@echo "# HTML:" ; find . -name '*.html' -type f -exec cat {} + | wc -l
|
|
-@echo "# CSS:" ; find . -name '*.css' -type f -exec cat {} + | wc -l
|
|
|
|
clean:
|
|
-@echo "### Cleaning *.pyc and .DS_Store files "
|
|
-@find . -name '*.pyc' -exec rm -f {} \;
|
|
-@find . -name '.DS_Store' -exec rm -f {} \;
|
|
|