djlaunch 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- djlaunch-0.3.0/.github/workflows/ci.yml +63 -0
- djlaunch-0.3.0/.github/workflows/publish.yml +62 -0
- djlaunch-0.3.0/.gitignore +42 -0
- djlaunch-0.3.0/.python-version +1 -0
- djlaunch-0.3.0/.vscode/extensions.json +7 -0
- djlaunch-0.3.0/.vscode/settings.json +21 -0
- djlaunch-0.3.0/AGENTS.md +223 -0
- djlaunch-0.3.0/CHANGELOG.md +101 -0
- djlaunch-0.3.0/LICENSE +21 -0
- djlaunch-0.3.0/PKG-INFO +311 -0
- djlaunch-0.3.0/README.md +285 -0
- djlaunch-0.3.0/docs/ROADMAP.md +124 -0
- djlaunch-0.3.0/docs/SPEC.md +347 -0
- djlaunch-0.3.0/pyproject.toml +100 -0
- djlaunch-0.3.0/src/djlaunch/__init__.py +5 -0
- djlaunch-0.3.0/src/djlaunch/__main__.py +4 -0
- djlaunch-0.3.0/src/djlaunch/cli.py +213 -0
- djlaunch-0.3.0/src/djlaunch/config.py +98 -0
- djlaunch-0.3.0/src/djlaunch/config_file.py +66 -0
- djlaunch-0.3.0/src/djlaunch/doctor.py +120 -0
- djlaunch-0.3.0/src/djlaunch/features.py +111 -0
- djlaunch-0.3.0/src/djlaunch/flavors.py +111 -0
- djlaunch-0.3.0/src/djlaunch/generator.py +96 -0
- djlaunch-0.3.0/src/djlaunch/py.typed +0 -0
- djlaunch-0.3.0/src/djlaunch/render.py +28 -0
- djlaunch-0.3.0/src/djlaunch/templates/README.md.j2 +153 -0
- djlaunch-0.3.0/src/djlaunch/templates/apps/core/apps.py.j2 +6 -0
- djlaunch-0.3.0/src/djlaunch/templates/apps/core/urls.py.j2 +10 -0
- djlaunch-0.3.0/src/djlaunch/templates/apps/core/views.py.j2 +24 -0
- djlaunch-0.3.0/src/djlaunch/templates/env.example.j2 +13 -0
- djlaunch-0.3.0/src/djlaunch/templates/features/docker/Dockerfile.j2 +26 -0
- djlaunch-0.3.0/src/djlaunch/templates/features/docker/docker-compose.yml.j2 +44 -0
- djlaunch-0.3.0/src/djlaunch/templates/features/docker/dockerignore.j2 +13 -0
- djlaunch-0.3.0/src/djlaunch/templates/features/postgresql/settings.py.j2 +14 -0
- djlaunch-0.3.0/src/djlaunch/templates/flavors/ninja/api.py.j2 +48 -0
- djlaunch-0.3.0/src/djlaunch/templates/flavors/ninja/apps.py.j2 +6 -0
- djlaunch-0.3.0/src/djlaunch/templates/flavors/ninja/schemas.py.j2 +10 -0
- djlaunch-0.3.0/src/djlaunch/templates/flavors/ninja/settings.py.j2 +10 -0
- djlaunch-0.3.0/src/djlaunch/templates/flavors/ninja/tests.py.j2 +50 -0
- djlaunch-0.3.0/src/djlaunch/templates/flavors/ninja/urls.py.j2 +9 -0
- djlaunch-0.3.0/src/djlaunch/templates/flavors/ninja/views.py.j2 +16 -0
- djlaunch-0.3.0/src/djlaunch/templates/flavors/vanilla/apps.py.j2 +6 -0
- djlaunch-0.3.0/src/djlaunch/templates/flavors/vanilla/serializers.py.j2 +10 -0
- djlaunch-0.3.0/src/djlaunch/templates/flavors/vanilla/settings.py.j2 +19 -0
- djlaunch-0.3.0/src/djlaunch/templates/flavors/vanilla/tests.py.j2 +44 -0
- djlaunch-0.3.0/src/djlaunch/templates/flavors/vanilla/urls.py.j2 +17 -0
- djlaunch-0.3.0/src/djlaunch/templates/flavors/vanilla/views.py.j2 +23 -0
- djlaunch-0.3.0/src/djlaunch/templates/gitignore.j2 +30 -0
- djlaunch-0.3.0/src/djlaunch/templates/manage.py.j2 +23 -0
- djlaunch-0.3.0/src/djlaunch/templates/project/asgi.py.j2 +9 -0
- djlaunch-0.3.0/src/djlaunch/templates/project/settings/base.py.j2 +114 -0
- djlaunch-0.3.0/src/djlaunch/templates/project/settings/development.py.j2 +6 -0
- djlaunch-0.3.0/src/djlaunch/templates/project/settings/production.py.j2 +23 -0
- djlaunch-0.3.0/src/djlaunch/templates/project/urls.py.j2 +10 -0
- djlaunch-0.3.0/src/djlaunch/templates/project/wsgi.py.j2 +9 -0
- djlaunch-0.3.0/src/djlaunch/templates/requirements/base.txt.j2 +9 -0
- djlaunch-0.3.0/src/djlaunch/templates/requirements/development.txt.j2 +7 -0
- djlaunch-0.3.0/src/djlaunch/templates/requirements/production.txt.j2 +7 -0
- djlaunch-0.3.0/src/djlaunch/templates/requirements.txt.j2 +1 -0
- djlaunch-0.3.0/tests/__init__.py +0 -0
- djlaunch-0.3.0/tests/helpers.py +30 -0
- djlaunch-0.3.0/tests/projects/README.md +21 -0
- djlaunch-0.3.0/tests/projects/vanilla-docker.yml +4 -0
- djlaunch-0.3.0/tests/projects/vanilla-full.yml +5 -0
- djlaunch-0.3.0/tests/projects/vanilla-minimal.yml +3 -0
- djlaunch-0.3.0/tests/projects/vanilla-postgresql.yml +4 -0
- djlaunch-0.3.0/tests/test_cli.py +230 -0
- djlaunch-0.3.0/tests/test_config.py +140 -0
- djlaunch-0.3.0/tests/test_config_file.py +77 -0
- djlaunch-0.3.0/tests/test_doctor.py +80 -0
- djlaunch-0.3.0/tests/test_flavors.py +40 -0
- djlaunch-0.3.0/tests/test_generator.py +300 -0
- djlaunch-0.3.0/tests/test_integration.py +36 -0
- djlaunch-0.3.0/tests/test_render.py +12 -0
- djlaunch-0.3.0/tests/test_vanilla_durability.py +170 -0
- djlaunch-0.3.0/uv.lock +1522 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
quality:
|
|
18
|
+
name: Format, lint, and type check
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v7
|
|
23
|
+
|
|
24
|
+
- name: Install uv and Python
|
|
25
|
+
uses: astral-sh/setup-uv@v10.4.0
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.12"
|
|
28
|
+
enable-cache: true
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: uv sync --locked
|
|
32
|
+
|
|
33
|
+
- name: Check formatting
|
|
34
|
+
run: uv run ruff format --check .
|
|
35
|
+
|
|
36
|
+
- name: Lint
|
|
37
|
+
run: uv run ruff check .
|
|
38
|
+
|
|
39
|
+
- name: Type check
|
|
40
|
+
run: uv run mypy
|
|
41
|
+
|
|
42
|
+
test:
|
|
43
|
+
name: Tests (Python ${{ matrix.python-version }})
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
strategy:
|
|
46
|
+
fail-fast: false
|
|
47
|
+
matrix:
|
|
48
|
+
python-version: ["3.12", "3.13", "3.14"]
|
|
49
|
+
|
|
50
|
+
steps:
|
|
51
|
+
- uses: actions/checkout@v7
|
|
52
|
+
|
|
53
|
+
- name: Install uv and Python
|
|
54
|
+
uses: astral-sh/setup-uv@v10.4.0
|
|
55
|
+
with:
|
|
56
|
+
python-version: ${{ matrix.python-version }}
|
|
57
|
+
enable-cache: true
|
|
58
|
+
|
|
59
|
+
- name: Install dependencies
|
|
60
|
+
run: uv sync --locked
|
|
61
|
+
|
|
62
|
+
- name: Test
|
|
63
|
+
run: uv run pytest
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
name: Build and verify distributions
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v7
|
|
17
|
+
|
|
18
|
+
- name: Install uv and Python
|
|
19
|
+
uses: astral-sh/setup-uv@v10.4.0
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.12"
|
|
22
|
+
enable-cache: true
|
|
23
|
+
|
|
24
|
+
- name: Check tag matches project version
|
|
25
|
+
run: |
|
|
26
|
+
version=$(uv run --no-project python -c "import pathlib, tomllib; print(tomllib.loads(pathlib.Path('pyproject.toml').read_text())['project']['version'])")
|
|
27
|
+
if [ "v$version" != "${GITHUB_REF_NAME}" ]; then
|
|
28
|
+
echo "Tag ${GITHUB_REF_NAME} does not match project version v$version" >&2
|
|
29
|
+
exit 1
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
- name: Test
|
|
33
|
+
run: uv run pytest
|
|
34
|
+
|
|
35
|
+
- name: Build
|
|
36
|
+
run: uv build
|
|
37
|
+
|
|
38
|
+
- name: Upload distributions
|
|
39
|
+
uses: actions/upload-artifact@v7
|
|
40
|
+
with:
|
|
41
|
+
name: dist
|
|
42
|
+
path: dist/
|
|
43
|
+
|
|
44
|
+
publish:
|
|
45
|
+
name: Publish to PyPI
|
|
46
|
+
needs: build
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
environment:
|
|
49
|
+
name: pypi
|
|
50
|
+
url: https://pypi.org/project/djlaunch/
|
|
51
|
+
permissions:
|
|
52
|
+
id-token: write
|
|
53
|
+
|
|
54
|
+
steps:
|
|
55
|
+
- name: Download distributions
|
|
56
|
+
uses: actions/download-artifact@v8
|
|
57
|
+
with:
|
|
58
|
+
name: dist
|
|
59
|
+
path: dist/
|
|
60
|
+
|
|
61
|
+
- name: Publish to PyPI
|
|
62
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
build/
|
|
6
|
+
dist/
|
|
7
|
+
wheels/
|
|
8
|
+
.venv/
|
|
9
|
+
venv/
|
|
10
|
+
|
|
11
|
+
# Test and coverage output
|
|
12
|
+
.pytest_cache/
|
|
13
|
+
.mypy_cache/
|
|
14
|
+
.ruff_cache/
|
|
15
|
+
htmlcov/
|
|
16
|
+
.coverage
|
|
17
|
+
.coverage.*
|
|
18
|
+
coverage.xml
|
|
19
|
+
|
|
20
|
+
# Environment files
|
|
21
|
+
.env
|
|
22
|
+
.env.*
|
|
23
|
+
!.env.example
|
|
24
|
+
|
|
25
|
+
# Django
|
|
26
|
+
*.log
|
|
27
|
+
db.sqlite3
|
|
28
|
+
db.sqlite3-journal
|
|
29
|
+
|
|
30
|
+
# Local generation smoke tests
|
|
31
|
+
.tmp-*/
|
|
32
|
+
|
|
33
|
+
# Docs
|
|
34
|
+
site/
|
|
35
|
+
|
|
36
|
+
# IDE and OS
|
|
37
|
+
.idea/
|
|
38
|
+
.vscode/*
|
|
39
|
+
!.vscode/extensions.json
|
|
40
|
+
!.vscode/settings.json
|
|
41
|
+
.DS_Store
|
|
42
|
+
Thumbs.db
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"python.testing.pytestEnabled": true,
|
|
3
|
+
"python.testing.pytestArgs": ["tests"],
|
|
4
|
+
"python.analysis.typeCheckingMode": "basic",
|
|
5
|
+
"[python]": {
|
|
6
|
+
"editor.defaultFormatter": "charliermarsh.ruff",
|
|
7
|
+
"editor.formatOnSave": true,
|
|
8
|
+
"editor.codeActionsOnSave": {
|
|
9
|
+
"source.fixAll.ruff": "explicit",
|
|
10
|
+
"source.organizeImports.ruff": "explicit"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files.exclude": {
|
|
14
|
+
"**/__pycache__": true,
|
|
15
|
+
"**/.pytest_cache": true,
|
|
16
|
+
"**/.mypy_cache": true,
|
|
17
|
+
"**/.ruff_cache": true,
|
|
18
|
+
"**/.coverage": true,
|
|
19
|
+
"**/htmlcov": true
|
|
20
|
+
}
|
|
21
|
+
}
|
djlaunch-0.3.0/AGENTS.md
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# djlaunch — agent context
|
|
2
|
+
|
|
3
|
+
## What this is
|
|
4
|
+
|
|
5
|
+
`djlaunch` is a CLI that generates **production-ready, API-only Django
|
|
6
|
+
projects**. One command produces a Dockerized API with PostgreSQL, secure
|
|
7
|
+
production settings, a health endpoint, and a documented API layer selected by
|
|
8
|
+
**flavor**.
|
|
9
|
+
|
|
10
|
+
- **Name:** `djlaunch`
|
|
11
|
+
- **PyPI:** [`djlaunch`](https://pypi.org/project/djlaunch/)
|
|
12
|
+
- **GitHub:** https://github.com/CasualEngineerZombie/djlaunch
|
|
13
|
+
- **License:** MIT
|
|
14
|
+
- **Current version:** `0.3.0` (first public release)
|
|
15
|
+
- **Python:** 3.12+
|
|
16
|
+
|
|
17
|
+
Read [docs/SPEC.md](docs/SPEC.md) for the flavor and integration design.
|
|
18
|
+
|
|
19
|
+
## Product direction
|
|
20
|
+
|
|
21
|
+
### API-only
|
|
22
|
+
|
|
23
|
+
No project-level HTML templates, CSS bundles, JavaScript frameworks, or CDN
|
|
24
|
+
frontend code. Django admin is the only HTML surface. WhiteNoise exists only to
|
|
25
|
+
serve admin static files. Do not reintroduce HTMX, Alpine.js, Tailwind, DaisyUI,
|
|
26
|
+
or a `templates/` / `static/` tree in generated projects.
|
|
27
|
+
|
|
28
|
+
The core API surface is JSON: `GET /` returns service metadata and
|
|
29
|
+
`GET /health/` is a liveness probe.
|
|
30
|
+
|
|
31
|
+
### Flavors
|
|
32
|
+
|
|
33
|
+
A flavor is the API framework, exactly one per project:
|
|
34
|
+
|
|
35
|
+
| Flavor | API layer |
|
|
36
|
+
|---|---|
|
|
37
|
+
| `vanilla` | Django REST Framework + drf-spectacular |
|
|
38
|
+
| `ninja` | Django Ninja |
|
|
39
|
+
| `modern` | django-modern-rest |
|
|
40
|
+
| `bolt` | django-bolt |
|
|
41
|
+
|
|
42
|
+
Flavors are **not** features. Features (cache, storage, email, observability,
|
|
43
|
+
deployment) are additive and shared by every flavor. Every flavor must expose
|
|
44
|
+
the same contract: routes under `/api/v1/`, OpenAPI schema at `/api/schema`,
|
|
45
|
+
docs at `/api/docs`, a `/api/v1/status/` endpoint, JWT auth (when enabled), and
|
|
46
|
+
generated tests.
|
|
47
|
+
|
|
48
|
+
### Infrastructure questionnaire
|
|
49
|
+
|
|
50
|
+
After the flavor, generation asks about cloud (`aws`, `gcp`, `azure`, `none`),
|
|
51
|
+
cache (`valkey`, `redis`, `custom`, `none`), object storage (`s3`, `gcs`,
|
|
52
|
+
`azure`, `none`), email (`resend`, `smtp`, `none`), Sentry, Datadog,
|
|
53
|
+
Prometheus + Grafana, Kubernetes, auth, and CI. PostgreSQL is always the
|
|
54
|
+
database. The answers become validated config and compose profiles; choosing a
|
|
55
|
+
cloud sets defaults but does not lock the project in.
|
|
56
|
+
|
|
57
|
+
### Production by default
|
|
58
|
+
|
|
59
|
+
Generated projects must be deployable without a checklist:
|
|
60
|
+
|
|
61
|
+
- PostgreSQL 18, `psycopg`, and a Compose database service by default.
|
|
62
|
+
- Docker image with a non-root user, collected admin static files, and a
|
|
63
|
+
`/health/` health check.
|
|
64
|
+
- Split settings; `production.py` loaded by WSGI/ASGI.
|
|
65
|
+
- HSTS, secure cookies, proxy-aware HTTPS redirects, and a health-check
|
|
66
|
+
exemption.
|
|
67
|
+
- No secrets in the repository; `.env.example` only.
|
|
68
|
+
- External integrations must be lazy and no-op without credentials.
|
|
69
|
+
|
|
70
|
+
## Current status
|
|
71
|
+
|
|
72
|
+
- `djlaunch create NAME` generates a runnable API-only Django 6.1 project.
|
|
73
|
+
- `--output-dir`, `--no-input`, `--feature`, `--preset`, `--flavor`, and
|
|
74
|
+
`--config` work.
|
|
75
|
+
- Docker and PostgreSQL are registered features with `default=True`.
|
|
76
|
+
- `vanilla` (DRF) and `ninja` (Django Ninja) are available flavors; each
|
|
77
|
+
exposes `/api/v1/`, `/api/schema`, `/api/docs`, and JWT auth.
|
|
78
|
+
- `apps/api/` (flavor) and `apps/core/` (shared `/` and `/health/`) are
|
|
79
|
+
generated, with contract tests under `apps/api/tests/`.
|
|
80
|
+
- The flavor owns the production server command; `vanilla` contributes
|
|
81
|
+
Gunicorn and `ninja` contributes Uvicorn.
|
|
82
|
+
- Production settings are hardened; Docker runs as non-root and has a
|
|
83
|
+
health check.
|
|
84
|
+
- 96 passed, 2 skipped; 93% coverage; Ruff + mypy clean.
|
|
85
|
+
- CI is green on Python 3.12, 3.13, and 3.14.
|
|
86
|
+
|
|
87
|
+
Not built yet: `modern` and `bolt` flavors, the infrastructure questionnaire,
|
|
88
|
+
compose profiles, and the v0.5 config schema.
|
|
89
|
+
|
|
90
|
+
## Repository layout
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
djlaunch/
|
|
94
|
+
├── src/djlaunch/
|
|
95
|
+
│ ├── cli.py # Click commands
|
|
96
|
+
│ ├── config.py # ProjectConfig validation
|
|
97
|
+
│ ├── config_file.py # project.yml loading
|
|
98
|
+
│ ├── doctor.py # Project diagnostics
|
|
99
|
+
│ ├── features.py # Additive feature registry + presets
|
|
100
|
+
│ ├── flavors.py # Exclusive API flavor registry
|
|
101
|
+
│ ├── generator.py # Template manifest + atomic generation
|
|
102
|
+
│ ├── render.py # Jinja environment
|
|
103
|
+
│ └── templates/ # Bundled project templates (.j2)
|
|
104
|
+
│ └── flavors/ # One directory per API flavor
|
|
105
|
+
├── tests/
|
|
106
|
+
├── docs/
|
|
107
|
+
│ ├── SPEC.md # Flavor, questionnaire, and config design
|
|
108
|
+
│ └── ROADMAP.md # Milestones
|
|
109
|
+
├── .github/workflows/ci.yml
|
|
110
|
+
├── pyproject.toml
|
|
111
|
+
└── CHANGELOG.md
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Commands
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
uv sync
|
|
118
|
+
uv run djlaunch --help
|
|
119
|
+
uv run djlaunch create my_project --output-dir /tmp
|
|
120
|
+
uv run djlaunch create my_project --no-input # Docker + PostgreSQL
|
|
121
|
+
uv run djlaunch create my_project --flavor vanilla # API framework
|
|
122
|
+
uv run djlaunch create my_project --preset minimal # no optional features
|
|
123
|
+
uv run djlaunch create my_project --preset full
|
|
124
|
+
uv run djlaunch create --config project.yml
|
|
125
|
+
uv run djlaunch doctor my_project
|
|
126
|
+
uv run ruff check .
|
|
127
|
+
uv run ruff format --check .
|
|
128
|
+
uv run mypy
|
|
129
|
+
uv run pytest
|
|
130
|
+
uv build
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Releasing
|
|
134
|
+
|
|
135
|
+
PyPI publishing uses trusted publishing; do not commit API tokens.
|
|
136
|
+
|
|
137
|
+
1. Bump `version` in `pyproject.toml` and `src/djlaunch/__init__.py`, move the
|
|
138
|
+
`CHANGELOG.md` entries out of `Unreleased`, and run `uv lock`.
|
|
139
|
+
2. Merge to `main`, wait for CI, then tag `vX.Y.Z` and push the tag.
|
|
140
|
+
3. `.github/workflows/publish.yml` checks the tag against the project version,
|
|
141
|
+
runs the tests, builds the distributions, and uploads them to PyPI through
|
|
142
|
+
the `pypi` environment.
|
|
143
|
+
|
|
144
|
+
## Conventions
|
|
145
|
+
|
|
146
|
+
- Source layout under `src/`.
|
|
147
|
+
- Single quotes, line length 100 (Ruff).
|
|
148
|
+
- All functions annotated; mypy checks `src/`.
|
|
149
|
+
- Tests live in `tests/` and use `pytest`, `tmp_path`, and `CliRunner`.
|
|
150
|
+
- Keep generated projects runnable: integration tests run `manage.py check`.
|
|
151
|
+
- The vanilla durability matrix lives in `tests/projects/`; add one YAML per
|
|
152
|
+
feature combination and keep `tests/test_vanilla_durability.py` green.
|
|
153
|
+
- Generated Python must also pass `ruff check` and `ruff format --check`.
|
|
154
|
+
- Coverage gate is 85%.
|
|
155
|
+
- Additive features belong in `features.py`. Do not add optional files to the
|
|
156
|
+
core `TEMPLATE_FILES` manifest.
|
|
157
|
+
- Flavors live in `flavors.py`; do not model them as features. A flavor owns its
|
|
158
|
+
`apps/api/` templates, settings fragment, requirements, installed apps, and
|
|
159
|
+
production server command.
|
|
160
|
+
- No HTML/frontend templates in generated projects. Generate JSON endpoints
|
|
161
|
+
and tests instead.
|
|
162
|
+
- When behavior changes, update `README.md`, `docs/ROADMAP.md`, `AGENTS.md`,
|
|
163
|
+
`CHANGELOG.md`, and `docs/SPEC.md` together. Do not document unbuilt
|
|
164
|
+
features as available; mark target work as planned.
|
|
165
|
+
|
|
166
|
+
## Architecture decisions
|
|
167
|
+
|
|
168
|
+
1. **Fresh repo, fresh history.** The old `modern-django-starter` repo is only a
|
|
169
|
+
reference. Do not copy its monolith back in.
|
|
170
|
+
2. **API-only.** No server-rendered pages or asset pipeline. Admin is the only
|
|
171
|
+
HTML surface; `/`, `/health/`, and `/api/v1/` are JSON.
|
|
172
|
+
3. **Flavors are exclusive; features are additive.** The flavor owns the API
|
|
173
|
+
framework, router, schema, auth wiring, and production server. It renders
|
|
174
|
+
`apps/api/` and `{project}/settings/flavor.py`, which `base.py` imports.
|
|
175
|
+
Features own infrastructure and must work with every flavor.
|
|
176
|
+
4. **One feature registry.** `features.py` is the single source of truth for
|
|
177
|
+
optional modules. Templates, requirements, env vars, and settings are
|
|
178
|
+
contributed from there; prompts, presets, and config files read the same
|
|
179
|
+
data.
|
|
180
|
+
5. **Production defaults, not production notes.** Docker and PostgreSQL are on
|
|
181
|
+
by default. Security headers, non-root containers, and health checks are
|
|
182
|
+
generated, not left as TODOs.
|
|
183
|
+
6. **Atomic generation.** Never write directly into the final target directory.
|
|
184
|
+
7. **Jinja for everything.** Generated files are Python, YAML, Markdown, or
|
|
185
|
+
config, so standard Jinja delimiters are enough. Do not reintroduce the
|
|
186
|
+
Django-template delimiter scheme.
|
|
187
|
+
8. **Config mirrors prompts.** Every question must be answerable
|
|
188
|
+
non-interactively through flags and `project.yml`. Validate choices and
|
|
189
|
+
conflicts before writing files.
|
|
190
|
+
9. **No synchronous external calls during generation, migrations, or user
|
|
191
|
+
creation.** The old project's Stripe bootstrap bug — a `post_save` signal
|
|
192
|
+
calling `Customer.get_or_create()` during `createsuperuser` and rolling back
|
|
193
|
+
on a missing key — is the cautionary tale. Integrations must no-op without
|
|
194
|
+
credentials.
|
|
195
|
+
10. **Contract-first APIs.** Each flavor exposes `/api/v1/`, `/api/schema`, and
|
|
196
|
+
`/api/docs`; the generated tests assert the contract, not just imports.
|
|
197
|
+
|
|
198
|
+
## Next milestone: v0.4 — flavor expansion
|
|
199
|
+
|
|
200
|
+
`ninja` shipped in 0.3.0. Remaining work:
|
|
201
|
+
|
|
202
|
+
1. Add `modern`: django-modern-rest with typed/async endpoints.
|
|
203
|
+
2. Add `bolt`: django-bolt with its Rust HTTP server and msgspec validation.
|
|
204
|
+
3. Give each flavor its production server: Gunicorn (WSGI), Uvicorn (ASGI), or
|
|
205
|
+
Bolt's server.
|
|
206
|
+
4. Add a CI job that generates every flavor and runs its contract tests.
|
|
207
|
+
5. Add `djlaunch flavors` to list flavors and their trade-offs.
|
|
208
|
+
|
|
209
|
+
Then v0.5 adds the infrastructure questionnaire. See
|
|
210
|
+
[docs/ROADMAP.md](docs/ROADMAP.md).
|
|
211
|
+
|
|
212
|
+
## Known follow-ups
|
|
213
|
+
|
|
214
|
+
- Published on PyPI as `djlaunch` 0.3.0. Future releases should use PyPI
|
|
215
|
+
trusted publishing from CI rather than a long-lived token.
|
|
216
|
+
- JWT auth is always generated in v0.3; `auth: none` arrives with v0.5.
|
|
217
|
+
- Generated projects still use `requirements/*.txt`; evaluate `pyproject.toml`
|
|
218
|
+
+ `uv` packaging before v1.0.
|
|
219
|
+
- Add readiness checks (`/health/ready/`), request IDs, structured JSON
|
|
220
|
+
logging, and environment validation that refuses development secrets.
|
|
221
|
+
- Add compose profiles for cache and observability services.
|
|
222
|
+
- Kubernetes manifests/Helm and CI templates are still planned.
|
|
223
|
+
- No upgrade path for existing generated projects yet.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project uses
|
|
5
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.3.0] - 2026-12-03
|
|
10
|
+
|
|
11
|
+
First public release.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- JSON API index at `/` and liveness probe at `/health/`.
|
|
16
|
+
- Production hardening: HSTS, secure cookies, referrer policy, proxy-aware
|
|
17
|
+
HTTPS redirects, and a health-check exemption.
|
|
18
|
+
- Docker image hardening: non-root user, collected admin static files, and a
|
|
19
|
+
container health check.
|
|
20
|
+
- Compose health check for the web service, automatic migrations at startup,
|
|
21
|
+
and a local HTTPS-redirect override.
|
|
22
|
+
- Docker and PostgreSQL are enabled by default (`--no-input` uses both).
|
|
23
|
+
- Flavor registry (`flavors.py`) with an exclusive API framework per project.
|
|
24
|
+
- `--flavor` flag and `flavor:` config key; `vanilla` is the default.
|
|
25
|
+
- `vanilla` flavor: Django REST Framework, drf-spectacular, JWT access/refresh
|
|
26
|
+
auth, and a generated `apps/api/` app.
|
|
27
|
+
- `/api/v1/status/`, `/api/schema`, and `/api/docs` in generated projects.
|
|
28
|
+
- Generated contract tests under `apps/api/tests/` covering status, schema,
|
|
29
|
+
docs, and token issuing.
|
|
30
|
+
- `ninja` flavor: Django Ninja, Pydantic schemas, JWT auth, and Uvicorn.
|
|
31
|
+
- Per-flavor durability matrix for `vanilla` covering minimal, Docker,
|
|
32
|
+
PostgreSQL, and full feature combinations.
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
- The generated project is API-only: no HTML templates, static bundles, HTMX
|
|
37
|
+
demo, or CDN frontend stack. Django admin is the only HTML surface.
|
|
38
|
+
- `djlaunch doctor` now checks the core API app instead of
|
|
39
|
+
`templates/base.html`.
|
|
40
|
+
- Generated README describes the API endpoints, production settings, and
|
|
41
|
+
Docker workflow.
|
|
42
|
+
- Package metadata and CLI help now describe API generation.
|
|
43
|
+
- The Jinja renderer uses standard delimiters only; the Django-template
|
|
44
|
+
delimiter mode was removed.
|
|
45
|
+
- The production server command is owned by the flavor; `vanilla` contributes
|
|
46
|
+
Gunicorn and `ninja` contributes Uvicorn instead of a hardcoded server.
|
|
47
|
+
- WhiteNoise middleware is added in production settings only, so development
|
|
48
|
+
runs without a missing `STATIC_ROOT` warning.
|
|
49
|
+
- The insecure default `SECRET_KEY` is long enough for JWT HMAC signing.
|
|
50
|
+
- Generated README documents the flavor, API endpoints, JWT usage, and tests.
|
|
51
|
+
|
|
52
|
+
### Removed
|
|
53
|
+
|
|
54
|
+
- `templates/base.html`, `templates/home.html`, `static/css/main.css`, and
|
|
55
|
+
`static/js/main.js` from generated projects.
|
|
56
|
+
- Tailwind CSS, DaisyUI, HTMX, and Alpine.js setup.
|
|
57
|
+
- `build_environment(django_syntax=True)` and its tests.
|
|
58
|
+
|
|
59
|
+
### Documentation
|
|
60
|
+
|
|
61
|
+
- Rewrote `README.md`, `AGENTS.md`, and `ROADMAP.md` around API-only generation,
|
|
62
|
+
flavors, and the infrastructure questionnaire.
|
|
63
|
+
- Added `docs/SPEC.md` with the flavor contract, integration matrix, CLI flags,
|
|
64
|
+
config schema, and validation rules.
|
|
65
|
+
|
|
66
|
+
## [0.2.0] - 2026-12-01
|
|
67
|
+
|
|
68
|
+
### Added
|
|
69
|
+
|
|
70
|
+
- Feature registry that is the single source of truth for optional modules.
|
|
71
|
+
- Feature dependency and conflict validation.
|
|
72
|
+
- `--feature` flag, repeatable for each optional module.
|
|
73
|
+
- `--preset minimal` and `--preset full`.
|
|
74
|
+
- `--config project.yml` for repeatable, non-interactive generation.
|
|
75
|
+
- Docker feature: `Dockerfile`, `docker-compose.yml`, `.dockerignore`.
|
|
76
|
+
- PostgreSQL feature: `psycopg`, database settings module, and env vars.
|
|
77
|
+
- `djlaunch doctor PATH` to check a generated project structurally and with
|
|
78
|
+
`manage.py check`.
|
|
79
|
+
- Feature-aware generated README and `.env.example`.
|
|
80
|
+
|
|
81
|
+
### Changed
|
|
82
|
+
|
|
83
|
+
- Template rendering strips block-tag whitespace, so generated Python files are
|
|
84
|
+
Ruff-clean.
|
|
85
|
+
- Requirement and environment templates include feature contributions.
|
|
86
|
+
|
|
87
|
+
## [0.1.0] - 2026-12-01
|
|
88
|
+
|
|
89
|
+
### Added
|
|
90
|
+
|
|
91
|
+
- Initial `djlaunch` foundation.
|
|
92
|
+
- `djlaunch create NAME` command with `--output-dir` and `--no-input`.
|
|
93
|
+
- Django 6.1 project generation with split settings, `python-decouple`,
|
|
94
|
+
WhiteNoise, HTMX, Alpine.js, Tailwind CSS, and DaisyUI.
|
|
95
|
+
- Atomic generation that refuses to overwrite an existing directory.
|
|
96
|
+
- Unit, CLI, and generated-project checks.
|
|
97
|
+
|
|
98
|
+
[Unreleased]: https://github.com/CasualEngineerZombie/djlaunch/compare/v0.3.0...HEAD
|
|
99
|
+
[0.3.0]: https://github.com/CasualEngineerZombie/djlaunch/releases/tag/v0.3.0
|
|
100
|
+
[0.2.0]: https://github.com/CasualEngineerZombie/djlaunch/compare/v0.1.0...v0.2.0
|
|
101
|
+
[0.1.0]: https://github.com/CasualEngineerZombie/djlaunch/releases/tag/v0.1.0
|
djlaunch-0.3.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rian
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|