-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (53 loc) · 1.63 KB
/
Makefile
File metadata and controls
65 lines (53 loc) · 1.63 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
# Default target
help:
@echo "Available commands:"
@echo " help Show this help message"
@echo " install Install dependencies"
@echo " run Run development server"
@echo " test Run tests"
@echo " tox Run tests with tox"
@echo " lint Run linting checks"
@echo " format Format code"
@echo " migrate Run database migrations"
@echo " makemigrations Create new migrations"
@echo " superuser Create superuser (admin/admin)"
@echo " shell Open Django shell"
@echo " collectstatic Collect static files"
@echo " clean Clean cache and temporary files"
# Installation
install:
uv pip install -e ".[testing,develoment]"
# Development server
run:
uv run manage.py runserver 0:8000
# Testing
test:
uv run manage.py test --verbosity=3
tox:
tox --skip-missing-interpreters
# Code quality
lint:
uv run ruff check
format:
uv run ruff format --check
# Django management
migrate:
uv run manage.py migrate
migrations:
uv run manage.py makemigrations
superuser:
@echo "Creating superuser (admin/admin)..."
@echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.filter(username='admin').exists() or User.objects.create_superuser('admin', 'admin@example.com', 'admin')" | python manage.py shell
@echo "Superuser created successfully!"
shell:
uv run manage.py shell
collectstatic:
python manage.py collectstatic --noinput
# Maintenance
clean:
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete
find . -type d -name "*.egg-info" -exec rm -rf {} +
rm -rf .tox/
rm -rf .coverage
rm -rf htmlcov/