The django-security skill provides comprehensive security guidelines and configurations for Django applications, covering authentication, authorization, CSRF protection, SQL injection and XSS prevention, and secure deployment settings. It is designed for Django developers setting up new projects, implementing user permissions, or preparing applications for production deployment. The skill solves the problem of securing Django applications against common vulnerabilities by providing production-ready code examples and best practices for security headers, password validation, custom user models, and HTTPS enforcement.

skills.sh installs
6.5K
GitHub stars
229.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add affaan-m/everything-claude-code --skill django-security --agent claude-code

Installs into .claude/skills of the current project.

Files

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

# 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
X_FRAME_OPTIONS = 'DENY'

# HTTPS and Cookies
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_SAMESITE = 'Lax'
CSRF_COOKIE_SAMESITE = 'Lax'

Sponsors

Details

Repository
github.com/affaan-m/everything-claude-code
Categories
Security, Python

More from affaan-m/everything-claude-code

All 256

Recommended

More Security
1affaan-m avatarspringboot-securityaffaan-m/everything-claude-codespringboot security6.4Kskills.sh installs
2affaan-m avatarlaravel-securityaffaan-m/everything-claude-codelaravel security5.7Kskills.sh installs
3affaan-m avatarsecurity-bounty-hunteraffaan-m/eccHunt for exploitable, bounty-worthy security issues in repositories. Focuses on remotely reachable vulnerabilities that qualify for real reports instead of nois5.5Kskills.sh installs
4yaklang avatarauthbypass-authentication-flawsyaklang/hack-skillsAuthentication bypass testing playbook. Use when assessing login flows, password reset logic, account recovery, MFA bypass, token predictability, brute-force re4Kskills.sh installs
5yaklang avatarjwt-oauth-token-attacksyaklang/hack-skillsJWT and OAuth token attack playbook. Use when validating token trust, signing algorithms, key handling, claim abuse, bearer flows, and OAuth account-binding wea4Kskills.sh installs
6affaan-m avatarsecurity-bounty-hunteraffaan-m/everything-claude-codesecurity bounty hunter3.7Kskills.sh installs