Modernize template: uv, Django 6.1, env-based settings, CI - #43
Merged
Merged
Conversation
- Replace requirements.txt with pyproject.toml + uv.lock (Python 3.13+) - Upgrade to Django 6.1; swap unmaintained drf-yasg/rest-swagger for drf-spectacular - Read settings from env/.env via django-environ (DATABASE_URL, EMAIL_URL -> MAILERS) - Production defaults: secure cookies/SSL redirect when DEBUG=false, whitenoise, gunicorn - uv-based multi-stage Dockerfile and compose.yaml with Postgres - Ruff lint/format and pytest-django tests - CI: lockfile check, lint, test matrix (py3.13/3.14 x sqlite/postgres), deploy check - Dependabot, LICENSE, CONTRIBUTING, SECURITY, issue/PR templates Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: astral-sh/setup-uv@v6 |
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: astral-sh/setup-uv@v6 |
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: astral-sh/setup-uv@v6 |
| environment: | ||
| POSTGRES_DB: app | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_PASSWORD: postgres |
|
|
||
| COPY . /app | ||
| RUN --mount=type=cache,target=/root/.cache/uv \ | ||
| uv sync --locked --no-dev |
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install dependencies | ||
| run: uv sync --locked |
| env: | ||
| POSTGRES_DB: app | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_PASSWORD: postgres |
| run: uv run --locked ruff check --output-format=github . | ||
|
|
||
| - name: Ruff format | ||
| run: uv run --locked ruff format --check . |
| run: uv lock --locked | ||
|
|
||
| - name: Ruff lint | ||
| run: uv run --locked ruff check --output-format=github . |
| path('auth/', include('djoser.urls')), | ||
| path('auth/', include('djoser.urls.jwt')), | ||
|
|
||
| def health(request): |
- Pin all GitHub Actions to commit SHAs (Dependabot keeps them updated) - Install with --locked --no-build and run with --no-sync in CI and Docker - Fix release.yml sha tag producing ":-<sha>" on pull requests - Allow overriding compose credentials via env; restrict /health/ to GET Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
pyproject.toml+uv.lockreplacerequirements.txt; Python 3.13+DATABASE_URL,EMAIL_URL(mapped to the newMAILERSsetting), CORS/CSRF/hostsDEBUG=false, whitenoise, gunicorn,/health/, uv multi-stage Dockerfile,compose.yamlwith Postgrescheck --deployTest plan
make lint,make testlocally (3.13 and 3.14)manage.py check --deploypasses at error level🤖 Generated with Claude Code