-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
97 lines (73 loc) · 1.99 KB
/
justfile
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
# Set the default recipe to list all available commands
default:
@just --list
# Set the uv run command
uvr := "uv run --extra test --locked"
#Set the uv command to run a tool
uvt := "uv tool run"
# Sync the package
sync:
uv sync --all-extras --locked
# Sync and upgrade the package
sync-up:
uv sync --all-extras --upgrade
# Run the Django development server
run:
{{uvr}} manage.py runserver
# Run the Django development server
arun:
{{uvr}} gunicorn --workers=2 --worker-class uvicorn_worker.UvicornWorker --bind 127.0.0.1:8000 config.asgi:application
# Make migrations
makemigrations:
{{uvr}} manage.py makemigrations
# Apply migrations
migrate:
{{uvr}} manage.py migrate
# Create a superuser
createsuperuser:
{{uvr}} manage.py createsuperuser
# Collect static files
collectstatic:
{{uvr}} manage.py collectstatic
# Run Django shell
shell:
{{uvr}} manage.py shell
# Check for any problems in your project
check:
{{uvr}} manage.py check
# Run pytest
test:
{{uvr}} pytest
# Run Ruff linking
lint:
{{uvt}} ruff check
# Run Ruff formatting
format:
{{uvt}} ruff format
# Lock the package version
lock:
uv lock
# Upgrade pre-commit hooks
pc-up:
{{uvt}} pre-commit autoupdate
# Run pre-commit hooks
pc-run:
{{uvt}} pre-commit run --all-files
# Run Docker compose up on the development environment
dc-up-dev:
docker-compose --file docker-compose-dev.yml up -d --build
# Run Docker compose logs on the development environment
dc-logs-dev:
docker-compose --file docker-compose-dev.yml logs -f
# Run a terminal on the development environment
dc-exec-dev:
docker compose --file docker-compose-dev.yml exec app /bin/bash
# Generate a secret key for Django
secret:
{{uvr}} manage.py shell -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
# Create a new Django app
startapp APPNAME:
{{uvr}} manage.py startapp {{APPNAME}}
# Generic manage command
@manage ARGS="":
{{uvr}} manage.py {{ARGS}}