Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@fcschmidt
Created May 13, 2019 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fcschmidt/39a0f6418c83eafac122cca2e40a54f6 to your computer and use it in GitHub Desktop.
Save fcschmidt/39a0f6418c83eafac122cca2e40a54f6 to your computer and use it in GitHub Desktop.
Makefile Django
.PHONY: test install pep8 clean
DB_NAME=db_name
test:
@echo 'Run coverage and starting tests'
@pytest --verbose --cov=app --color=yes tests/
report:
@echo 'Report coverage and generate html'
coverage report
coverage html -d coverage_html
init:
@echo 'Create environment and Instal dependences'
@virtualenv -p python3.6 .venv
@source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
migrate:
@echo 'Created Migrations'
python manage.py migrate
createdb:
@echo 'Create Data base (PostgreSQL Data Base)'
createdb $(DB_NAME)
@echo 'Data Base $(DB_NAME) Create Successfully'
dropdb:
@echo 'Drop Data base'
dropdb $(DB_NAME)
@echo 'Data Base $(DB_NAME) Delete Successfully'
run:
@echo 'Start application'
python manage.py runserver
clean:
rm -rf migrations .coverage coverage_html .pytest_cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment