What problem does it solve?
This Skill helps you secure a Django application by providing practical, production-focused guidance to reduce risk from authentication flaws, authorization mistakes, CSRF weaknesses, SQL injection, XSS, and insecure deployment or security headers.
Core Features & Use Cases
- Production security configuration: Set HTTPS-only cookies, strong HSTS, MIME sniffing protection, clickjacking defense, and safe browser behavior.
- Authentication & session hardening: Configure a custom user model, strong password validation and hashers (including Argon2), and safer session cookie behavior.
- Authorization controls: Implement permissions, object-level checks, and RBAC patterns to prevent privilege escalation.
- Injection and scripting defenses: Use Django ORM safely to prevent SQL injection and rely on template escaping/encoding plus safe HTML handling to prevent XSS.
- CSRF and API protection: Keep CSRF protection enabled and apply DRF authentication, permission requirements, and rate limiting for APIs.
- Secure file upload and security headers: Validate uploaded files and add defensive HTTP headers and CSP to reduce browser attack surface.
Quick Start
Use the django-security skill to generate a checklist of Django production settings you can apply to your project to prevent SQL injection, XSS, CSRF issues, and insecure headers.