-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
99 lines (68 loc) · 3.68 KB
/
Makefile
File metadata and controls
99 lines (68 loc) · 3.68 KB
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
sync: ## Makes your locally installed packages match the ones specified in `pyproject.toml`.
uv sync --group dev
manage: ## Runs the Django management command specified by passing `args`.
uv run $(uv_args) manage.py $(args)
shell: ## Enters a Django shell, with most common classes automatically imported.
make manage args="shell_plus"
migrate: ## Updates the database schema from the migration files.
make manage args="migrate $(args)"
makemigrations: ## Creates migration files from the models, if there are any changes.
make manage args="makemigrations $(args)"
makemessages: ## Extracts all translatable strings from the codebase and updates the `.po` files with them.
make manage args="makemessages $(args)"
makemessages-all: ## Runs `makemessages` for all languages and domains.
make makemessages args="-a"
make makemessages args="-a -d djangojs"
compilemessages: ## Updates the `.mo` files from the `.po` files.
make manage args="compilemessages $(args)"
collectstatic: ## "Compiles" the static files (CSS and JS files, images, etc.) into the `STATIC_ROOT` folder.
make manage args="collectstatic --no-input"
update: ## Updates the installed packages, database and static files.
make sync
make migrate
make collectstatic
createsuperuser: ## Creates a superuser.
make manage args="createsuperuser"
start: ## Starts the Django webserver.
make manage args="runserver $(args)"
test: ## Runs the test suite. Pass extra arguments with `args`, e.g. `args="-k 'test_function'"`.
make manage args="test $(args)"
lint: ## Runs pre-commit hooks against all files. Provide the `hook` arg to only run that specific hook.
uv run $(uv_args) pre-commit run $(hook) --all-files
### Docker ###
COMPOSE_FILE := docker/compose.dev.yaml
d-compose: ## Run Docker Compose for development with `make_ntnu` as project name. Helper command to run any compose command.
docker compose -f '$(COMPOSE_FILE)' -p make_ntnu $(args)
d-build: ## Rebuilds the container image. Use when changes are made to the Dockerfile or the dependencies in `pyproject.toml`.
make d-compose args="build"
d-down: ## Stops and removes the container.
make d-compose args="down"
d-bash: ## Enters a bash shell in an already-running `web` container.
make d-compose args="exec web bash"
d-manage: ## Runs the Django management command specified by passing `args`.
make d-compose args="run --rm web uv run manage.py $(args)"
d-shell: ## Enters a Django shell, with most common classes automatically imported.
make d-manage args="shell_plus"
d-migrate: ## Updates the database schema from the migration files.
make d-manage args="migrate $(args)"
d-makemigrations: ## Creates migration files from the models, if there are any changes.
make d-manage args="makemigrations $(args)"
d-makemessages: ## Extracts all translatable strings from the codebase and updates the `.po` files with them.
make d-manage args="makemessages $(args)"
d-makemessages-all: ## Runs `makemessages` for all languages and domains.
make d-makemessages args="-a"
make d-makemessages args="-a -d djangojs"
d-compilemessages: ## Updates the `.mo` files from the `.po` files.
make d-manage args="compilemessages $(args)"
d-collectstatic: ## "Compiles" the static files (CSS and JS files, images, etc.) into the `STATIC_ROOT` folder.
make d-manage args="collectstatic --no-input"
d-update: ## Updates the container, database and static files.
make d-build
make d-migrate
make d-collectstatic
d-createsuperuser: ## Creates a superuser.
make d-manage args="createsuperuser"
d-start: ## Starts the Django webserver.
make d-compose args="up $(args)"
d-test: ## Runs the test suite. Pass extra arguments with `args`, e.g. `args="-k 'test_function'"`.
make d-manage args="test $(args)"