-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
57 lines (41 loc) · 1.33 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.DEFAULT_GOAL := help
ROOT_DIR := ./
VENV_BIN_DIR:=venv/bin
PIP:="$(VENV_BIN_DIR)/pip"
hello:
@echo "Hello, World!"
help: ## Show this help
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
define create-venv
python3 -m venv venv
endef
venv: # Create virtual environment
@$(create-venv)
install: venv # Install project dependencies
@$(PIP) install -r requirements.txt
freeze: venv # Freeze project dependencies
@$(PIP) freeze > requirements.txt
migrate: venv # Run database migrations
@python manage.py migrate
run: venv # Run the development server
@python manage.py runserver
admin: venv # Create admin superuser
@python manage.py createsuperuser
shell: venv # Start a Django shell
@python manage.py shell
test: venv # Run tests with coverage
@coverage run manage.py test
@coverage html
check: venv # Perform system check
@python manage.py check
populatedb: venv # Populate the database with fake records
@python manage.py populate_db 5
collectstatic: venv # Run the collectstatic command
@python manage.py collectstatic
clean: ## Clean up the project of unneeded files
@rm -rf .cache
@rm -rf htmlcov coverage.xml .coverage
@find . -name '*.pyc' -delete
@find . -name 'db.sqlite3' -delete
@find . -type d -name '__pycache__' -exec rm -r {} \+
@rm -rf .tox