---
name: django-security
description: Django security best practices, authentication, authorization, CSRF protection, SQL injection prevention, XSS prevention, and secure deployment configurations.
---


# Django Security Best Practices

Comprehensive security guidelines for Django applications to protect against common vulnerabilities.

## When to Activate

- Setting up Django authentication and authorization
- Implementing user permissions and roles
- Configuring production security settings
- Reviewing Django application for security issues
- Deploying Django applications to production

## Related Agents

- `security-reviewer` - Security review (Sonnet)

## Detailed References

- **Core Security Settings**: See [references/core-security-settings.md](references/core-security-settings.md)
- **Authentication**: See [references/authentication.md](references/authentication.md)
- **Authorization**: See [references/authorization.md](references/authorization.md)
- **SQL Injection Prevention**: See [references/sql-injection-prevention.md](references/sql-injection-prevention.md)
- **XSS Prevention**: See [references/xss-prevention.md](references/xss-prevention.md)
- **CSRF Protection**: See [references/csrf-protection.md](references/csrf-protection.md)
- **File Upload Security**: See [references/file-upload-security.md](references/file-upload-security.md)
- **API Security**: See [references/api-security.md](references/api-security.md)
- **Security Headers**: See [references/security-headers.md](references/security-headers.md)
- **Environment Variables**: See [references/environment-variables.md](references/environment-variables.md)
- **Logging Security Events**: See [references/logging-security-events.md](references/logging-security-events.md)
- **Quick Security Checklist**: See [references/quick-security-checklist.md](references/quick-security-checklist.md)
