django-security
Django security best practices, authentication, authorization, CSRF protection, SQL injection prevention, XSS prevention, and secure deployment configurations. Use when reviewing Django authentication, authorization, input handling, or deployment settings.
- Kind
- Skill
- Works with
- Claude Code, Codex
- Languages
- Python, SQL
- Source
- affaan-m/ECC @ d3b8a3e90890
- Path
- skills/django-security/SKILL.md
- Jobs
- Guardrails, Review
- Topics
- Security audits
Credit
- Made by
- affaan-m
- Original
- github.com/affaan-m/ECC/blob/d3b8a3e908904e242ed2dbe66af62cca…
- License
- MIT
Listed by Skill Manifest; not made by us.
InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
Install factsScanned 3 Nov 2026
- Adds
- .claude/skills/django-security/ (the skill folder)
- Runs scripts
- None found
- Uses the network
- Yes
- HTTP client calls
- downloads Python packages
- Needs secrets
- Yes
- DJANGO_SECRET_KEY
- SECRET_KEY
- Reads environment variables
- ALLOWED_HOSTS
- DJANGO_SECRET_KEY
- SECRET_KEY
- Reads outside the project
- /var/www/media/ (SKILL.md)
- /var/log/django/security.log (SKILL.md)
- Calls other skills
- /script
- /span
- /button
- /form
- Source revision
- d3b8a3e90890
- Licence
- MIT
- Last activity
- 23 Nov 2026
- Source changed after the scan
- Yes
- Last push 23 Nov 2026, scanned 3 Nov 2026; read it again before you rely on this scan
- Review
- Reviewed
Found by a static scan of the stored text; nothing is run. “None found” is not a guarantee, so read what you install before you run it.
# 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
## Core Security Settings
### Production Settings Configuration
```python
# settings/production.py
import os
DEBUG = False # CRITICAL: Never use True in production
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '').split(',')
# Security headers
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SECURE_HSTS_SECONDS = 31536000 # 1 year
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
SECURE_HSTS_PRELOAD = True
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_BROWSER_XSS_FILTER = True
X_FRAME_OPTIONS = 'DENY'
# HTTPS and Cookies
SESSION_COOKIE_HTTPONLY = True
CSRF_COOKIE_HTTPONLY = True
SESSION_COOKIE_SAMESITE = 'Lax'
CSRF_COOKIE_SAMESITE = 'Lax'
# Secret key (must be set via environment variable)
SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY')
if not SECRET_KEY:
…