Django Verification Loop
Run before PRs, after major changes, and pre-deploy. Phases 1–12 in references/, automation in scripts/verify.sh, CI in references/ci.yml, report in references/report-template.md.
When to Activate
- Before opening a pull request for a Django project
- After major model changes, migration updates, or dependency upgrades
- Pre-deployment verification for staging or production
- Running full environment → lint → test → security → deploy readiness pipeline
- Validating migration safety and test coverage
Phases (resumo)
| # |
Phase |
Gate |
| 1 |
Environment (python version, venv, env vars) |
configured |
| 2 |
Lint (mypy, ruff, black, isort, manage.py check --deploy) |
clean |
| 3 |
Migrations (showmigrations, makemigrations --check, migrate --plan) |
none pending, no conflicts |
| 4 |
Tests (pytest + coverage ≥80%: models 90, serializers 85, views 80, services 90) |
all green |
| 5 |
Security (pip-audit, safety, bandit, gitleaks, check --deploy) |
no vulns, DEBUG False |
| 6 |
Commands (check, collectstatic, superuser, DB integrity, cache) |
all ok |
| 7 |
Performance (N+1 via toolbar, indexes, <50 queries/page) |
acceptable |
| 8 |
Assets (npm audit, build, findstatic) |
collected |
| 9 |
Config (DEBUG False, SECRET_KEY 30+, ALLOWED_HOSTS, HTTPS/HSTS, non-sqlite DB) |
valid |
| 10 |
Logging (warning/error emit, writable log files) |
working |
| 11 |
API docs (generateschema, valid JSON, Swagger UI) |
current |
| 12 |
Diff (no print/pdb/DEBUG=True, no TODOs, no secrets, migrations included) |
clean |
./scripts/verify.sh # fases 1–5 automatizadas
Pre-Deployment Checklist (resumo)
Tests green + coverage ≥80% · no vulns · no pending migrations · DEBUG False · SECRET_KEY + ALLOWED_HOSTS · backups on · static collected · logging + Sentry · CDN/cache/Celery/HTTPS/env documented as applicable.
Quick Reference
| Check |
Command |
| Environment |
python --version |
| Type checking |
mypy . |
| Linting |
ruff check . |
| Formatting |
black . --check |
| Migrations |
python manage.py makemigrations --check |
| Tests |
pytest --cov=apps |
| Security |
pip-audit && bandit -r . |
| Django check |
python manage.py check --deploy |
| Collectstatic |
python manage.py collectstatic --noinput |
| Diff stats |
git diff --stat |
Remember: Automated verification catches common issues but doesn't replace manual code review and testing in staging environment.
1---2name: django-verification3description: "Use when verification loop for Django projects: migrations, linting, tests with coverage, security scans, and deployment readiness checks before release or PR. Only for Django — not for other stacks. Triggers on \"django-verification\", \"django verification\", \"verification\"."4metadata:5 source: https://skillmd.com/skills/majinmagros/django-verification6 origin: ECC7---89# Django Verification Loop1011Run before PRs, after major changes, and pre-deploy. Phases 1–12 in `references/`, automation in `scripts/verify.sh`, CI in `references/ci.yml`, report in `references/report-template.md`.1213## When to Activate1415- Before opening a pull request for a Django project16- After major model changes, migration updates, or dependency upgrades17- Pre-deployment verification for staging or production18- Running full environment → lint → test → security → deploy readiness pipeline19- Validating migration safety and test coverage2021## Phases (resumo)2223| # | Phase | Gate |24|---|---|---|25| 1 | **Environment** (python version, venv, env vars) | configured |26| 2 | **Lint** (mypy, ruff, black, isort, `manage.py check --deploy`) | clean |27| 3 | **Migrations** (showmigrations, makemigrations --check, migrate --plan) | none pending, no conflicts |28| 4 | **Tests** (pytest + coverage ≥80%: models 90, serializers 85, views 80, services 90) | all green |29| 5 | **Security** (pip-audit, safety, bandit, gitleaks, `check --deploy`) | no vulns, DEBUG False |30| 6 | **Commands** (check, collectstatic, superuser, DB integrity, cache) | all ok |31| 7 | **Performance** (N+1 via toolbar, indexes, <50 queries/page) | acceptable |32| 8 | **Assets** (npm audit, build, findstatic) | collected |33| 9 | **Config** (DEBUG False, SECRET_KEY 30+, ALLOWED_HOSTS, HTTPS/HSTS, non-sqlite DB) | valid |34| 10 | **Logging** (warning/error emit, writable log files) | working |35| 11 | **API docs** (generateschema, valid JSON, Swagger UI) | current |36| 12 | **Diff** (no print/pdb/`DEBUG=True`, no TODOs, no secrets, migrations included) | clean |3738```bash39./scripts/verify.sh # fases 1–5 automatizadas40```4142## Pre-Deployment Checklist (resumo)4344Tests green + coverage ≥80% · no vulns · no pending migrations · DEBUG False · SECRET_KEY + ALLOWED_HOSTS · backups on · static collected · logging + Sentry · CDN/cache/Celery/HTTPS/env documented as applicable.4546## Quick Reference4748| Check | Command |49|-------|---------|50| Environment | `python --version` |51| Type checking | `mypy .` |52| Linting | `ruff check .` |53| Formatting | `black . --check` |54| Migrations | `python manage.py makemigrations --check` |55| Tests | `pytest --cov=apps` |56| Security | `pip-audit && bandit -r .` |57| Django check | `python manage.py check --deploy` |58| Collectstatic | `python manage.py collectstatic --noinput` |59| Diff stats | `git diff --stat` |6061Remember: Automated verification catches common issues but doesn't replace manual code review and testing in staging environment.