Skip to content
affaan-m avatar

Django Security

Django security guide covering authentication, authorization, SQL injection, XSS prevention, and production hardening.

CCM score
71 of 100
skills.sh installs
14.4K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers production settings, custom user models, password hashing, sessions, permissions, and RBAC, with code for each
  • Includes Django ORM and raw-SQL parameterization patterns, plus template escaping rules for XSS prevention
  • Enforces DEBUG = False, required DJANGO_SECRET_KEY, HSTS, secure cookies, and a 12-character minimum password length
  • Designed for reviewing Django authentication, authorization, input handling, and deployment settings before production release

Install

$ npx -y skills add affaan-m/ecc --skill django-security -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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'

Details

Repository
github.com/affaan-m/ecc
Categories
Security, Backend & APIs, Python
First seen
Jul 14, 2026

Questions

What does the django-security skill do?

The django-security skill gives an agent Django security best practices, covering authentication, authorization, CSRF protection, SQL injection prevention, XSS prevention and secure deployment settings. It is meant for reviewing Django authentication, authorization, input handling or deployment settings.

How do I install the django-security skill?

Run npx -y skills add affaan-m/ecc --skill django-security -y in your project to install it. Once installed, the agent can apply Django hardening guidance such as production settings, password validation and permission checks to your code.

Where does django-security rank among security skills?

On the Security category page on Claude Marketplaces, django-security ranks in the top 50. Other skills near it include azure-compliance, entra-agent-id, firebase-security-rules-auditor, security-audit and cloudflare-one.

What does django-security cover that sets it apart?

It goes beyond general security advice by giving Django-specific guidance, including production settings such as secure cookies, HSTS and SECRET_KEY handling. It also covers Django ORM query safety, template escaping for XSS, and custom permission classes for role-based access.

More from affaan-m/ecc

All 257

Similar to Django Security

More Security