Run the full Django verification loop — environment check, mypy/ruff/black linting, migration safety, pytest with coverage targets, pip-audit and bandit secu…
Install the skill above, then run this in your AI tool:
/django-verification <your description>
About
Run before PRs, after major changes, and pre-deploy to ensure Django application quality and security.
Source
What gets added to your project
Preview every file this package writes on install before you run the command above.
Summary
Run the full Django verification loop — environment check, mypy/ruff/black linting, migration safety, pytest with coverage targets, pip-audit and bandit security scans, settings and logging review, and diff review — producing a phased pa...
Skill instructions
Django Verification Loop
Run before PRs, after major changes, and pre-deploy to ensure Django application quality and security.
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
Phase 1: Environment Check
bash
# Verify Python version
python --version # Should match project requirements# Check virtual environmentwhich python
pip list --outdated
# Verify environment variables
python -c "import os; import environ; print('DJANGO_SECRET_KEY set' if os.environ.get('DJANGO_SECRET_KEY') else 'MISSING: DJANGO_SECRET_KEY')"
If environment is misconfigured, stop and fix.
Phase 2: Code Quality & Formatting
bash
# Type checking
mypy . --config-file pyproject.toml
# Linting with ruff
ruff check . --fix
# Formatting with black
black . --check
black . # Auto-fix# Import sorting
isort . --check-only
isort . # Auto-fix# Django-specific checks
python manage.py check --deploy
# Run all tests with pytest
pytest --cov=apps --cov-report=html --cov-report=term-missing --reuse-db
# Run specific app tests
pytest apps/users/tests/
# Run with markers
pytest -m "not slow"# Skip slow tests
pytest -m integration # Only integration tests# Coverage report
open htmlcov/index.html
# Django Debug Toolbar output (check for N+1 queries)# Run in dev mode with DEBUG=True and access a page# Look for duplicate queries in SQL panel# Query count analysis
django-admin debugsqlshell # If django-debug-sqlshell installed# Check for missing indexes
python manage.py shell << EOF
from django.db import connection
with connection.cursor() as cursor:
cursor.execute("SELECT table_name, index_name FROM information_schema.statistics WHERE table_schema = 'public'")
print(cursor.fetchall())
EOF
Report:
Number of queries per page (should be < 50 for typical pages)
Missing database indexes
Duplicate queries detected
Phase 8: Static Assets
bash
# Check for npm dependencies (if using npm)
npm audit
npm audit fix
# Build static files (if using webpack/vite)
npm run build
# Verify static filesls -la staticfiles/
python manage.py findstatic css/style.css
Phase 9: Configuration Review
python
# Run in Python shell to verify settings
python manage.py shell << EOF
from django.conf import settings
import os
# Critical checks
checks = {
'DEBUG is False': not settings.DEBUG,
'SECRET_KEY set': bool(settings.SECRET_KEY andlen(settings.SECRET_KEY) > 30),
'ALLOWED_HOSTS set': len(settings.ALLOWED_HOSTS) > 0,
'HTTPS enabled': getattr(settings, 'SECURE_SSL_REDIRECT', False),
'HSTS enabled': getattr(settings, 'SECURE_HSTS_SECONDS', 0) > 0,
'Database configured': settings.DATABASES['default']['ENGINE'] != 'django.db.backends.sqlite3',
}
for check, result in checks.items():
status = '✓'if result else'✗'print(f"{status}{check}")
EOF
Add this badge to a GitHub README so readers can open the package page and install the same version.
[](https://www.aipm-registry.com/skills/affaan-m/django-verification/1.0.0?utm_source=github&utm_medium=readme&utm_campaign=package_badge)
This imported publisher has not claimed its AIPM account. A connected account confirms account control, but it does not guarantee that a package is safe.
AI assistant context
What this skill is for
@affaan-m/django-verification@1.0.0 is an AIPM skill package for All tools. Use it when a project needs the reusable AI behavior described as: Run the full Django verification loop — environment check, mypy/ruff/black linting, migration safety, pytest with coverage targets, pip-audit and bandit security scans, settings and logging review, and diff review — producing a phased pa...
Run aipm add @affaan-m/django-verification@1.0.0 in a project that has AIPM initialized.
Supported tools
@affaan-m/django-verification@1.0.0 supports All tools.
Before installing
AIPM skills can add files to your project. Review the package name, target, description, license, and publisher before installing. Use a clean branch when trying a new skill.