-
Notifications
You must be signed in to change notification settings - Fork 102
/
Makefile
111 lines (76 loc) · 2.19 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
.env:
test ! -f .env && cp .env.example .env
build-production:
pip install -r requirements.txt
$(MAKE) collectstatic
$(MAKE) migrate
build:
uv run python manage.py migrate
check: lint test requirements.txt
collectstatic:
uv run python manage.py collectstatic --no-input
compose-build: .env
docker compose build
compose-clear:
docker compose down -v || true
compose-down:
docker compose down || true
compose-setup: compose-build
docker compose run --rm django make setup
compose-start:
docker compose up --abort-on-container-exit
compose-stop:
docker compose stop || true
compose-sync:
docker compose run --rm django make sync ARGS="$(ARGS)"
deploy:
git push heroku
setup-pre-commit-hooks:
uv run pre-commit install
install-dependencies: .env
uv sync
install: install-dependencies setup-pre-commit-hooks
lint:
uv run ruff check
migrate:
uv run python manage.py migrate
requirements.txt:
uv pip compile pyproject.toml -o requirements.txt
secretkey:
uv run python -c 'from django.utils.crypto import get_random_string; print(get_random_string(40))'
setup: install
$(MAKE) migrate
$(MAKE) updatesuperuser
updatesuperuser:
uv run python manage.py updatesuperuser --username admin --email [email protected]
shell:
uv run python manage.py shell_plus --plain
start-deploy:
uv run gunicorn config.wsgi
start-production:
uv run gunicorn -b 0.0.0.0:8000 config.wsgi:application
start:
uv run python manage.py runserver 0.0.0.0:8000
sync:
uv run python manage.py fetchdata $(ARGS)
test-coverage-report-xml:
uv run coverage xml
test-coverage-report: test
uv run coverage report -m $(ARGS)
uv run coverage erase
test:
uv run coverage run --source='.' manage.py test
transcompile:
uv run django-admin compilemessages
# Need to have GNU gettext installed
transprepare:
uv run django-admin makemessages --locale ru --add-location file
uv run django-admin makemessages --locale ru --add-location file --domain djangojs
# Need to have graphviz installed
erd-dot:
uv run python manage.py graph_models -a -g > erd.dot
erd-in-png: erd-dot
dot -Tpng erd.dot -o erd.png
erd-in-pdf: erd-dot
dot -Tpdf erd.dot -o erd.pdf
.PHONY: install setup shell lint test check start sync secretkey requirements.txt