-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (64 loc) · 2.63 KB
/
Makefile
File metadata and controls
80 lines (64 loc) · 2.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
include config.mk
##########################################################################
# MENU
##########################################################################
.PHONY: help
help:
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
data/:
mkdir -p data/
env:
cp env.example env
.venv/: data/ env
python -m venv .venv/
source venv/bin/activate && pip install --upgrade pip
source venv/bin/activate && pip install -r requirements.txt
source venv/bin/activate && pip install -r requirements-dev.txt
source venv/bin/activate && pre-commit install
.PHONY: migrate
migrate: ## Run Django migrations
docker compose run -it --rm django ./manage.py migrate
.PHONY: superuser
superuser: ## Create a superuser
docker compose run -it --rm django ./manage.py createsuperuser
.PHONY: dev-bootstrap
dev-bootstrap: .venv/ ## Bootstrap the development environment
docker compose pull
docker compose build
docker compose up -d postgres
$(MAKE) migrate
$(MAKE) superuser
docker compose down
.PHONY: dev-start
dev-start: ## Start the development environment
docker compose up -d
sleep 5
curl --request PUT http://localhost:9000/testbucket
.PHONY: dev-stop
dev-stop: ## Stop the development environment
docker compose down
.PHONY: dev-restart-django
dev-restart-django: ## Restart the Django service
docker compose up -d --force-recreate django
.PHONY: snapshot-local-db
snapshot-local-db: ## Create a snapshot of the local database
docker compose exec postgres pg_dump -U postgres -Fc django_reference > django_reference.dump
.PHONY: restore-local-db
restore-local-db: ## Restore the local database from a snapshot
docker compose exec -T postgres pg_restore -U postgres -d django_reference < django_reference.dump
##########################################################################
# DJANGO-ALLAUTH DEPENDENCY MANAGEMENT
##########################################################################
.PHONY: dev-allauth
dev-allauth: ## Switch to local editable django-allauth install (if workspace exists)
@echo "⚠️ Local development not fully working yet - use prod-allauth instead"
@exit 1
.PHONY: prod-allauth
prod-allauth: ## Switch to remote git django-allauth source
-uv remove django-allauth
uv add "django-allauth[mfa,socialaccount] @ git+https://github.com/heysamtexas/django-allauth.git@heysamtexas-patches"
@echo "✅ Switched to remote git django-allauth"
.PHONY: allauth-status
allauth-status: ## Show current django-allauth source
@echo "Current django-allauth dependency:"
@grep "django-allauth" pyproject.toml || echo "django-allauth not found in pyproject.toml"