-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
64 lines (46 loc) · 1003 Bytes
/
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
VENV_NAME := env
VENV = . env/bin/activate &&
MANAGE = python manage.py
#########
# LOCAL #
#########
venv:
if [ ! -d $(VENV_NAME) ]; then \
python -m venv $(VENV_NAME); \
fi
install: venv
$(VENV) pip install -U pip
$(VENV) pip install -r requirements.txt
migrations: venv
$(VENV) $(MANAGE) makemigrations
migrate: venv
$(VENV) $(MANAGE) migrate
superuser: venv
$(VENV) DJANGO_SUPERUSER_USERNAME=django \
DJANGO_SUPERUSER_PASSWORD=django \
DJANGO_SUPERUSER_EMAIL="[email protected]" \
$(MANAGE) createsuperuser --noinput
runserver: venv
$(VENV) $(MANAGE) runserver 8002
shell: venv
$(VENV) $(MANAGE) shell
command: venv
$(VENV) $(MANAGE) create_thumbnails
test: venv
$(VENV) pytest
init: install migrate superuser
start: runserver
##########
# FORMAT #
##########
check:
$(VENV) ruff check
isort:
$(VENV) ruff check --select I --fix
format:
$(VENV) ruff check --select I --fix && ruff format
#############
# API TESTS #
#############
apitest:
sh scripts/apitest.sh