romankovsv/claude-code-python-devops-mlops/django-security

Claude Code and agent skill by romankovsv/claude-code-python-devops-mlops

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Django security best practices, authentication, authorization, CSRF protection, SQL injection prevention, XSS prevention, and secure deployment configurations.

Install

npx vskill@latest install romankovsv/claude-code-python-devops-mlops/django-security

SKILL.md

The same SKILL.md was published earlier as izangi2714/claude-code-python-stack/django-security.

Django Security Best Practices

Comprehensive security guidelines for Django applications.

When to Activate

  • Setting up Django authentication and authorization
  • Implementing user permissions and roles
  • Configuring production security settings
  • Reviewing Django application for security issues

Core Security Settings

python
# settings/production.py
DEBUG = False
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '').split(',')
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SECURE_HSTS_SECONDS = 31536000
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
SECURE_CONTENT_TYPE_NOSNIFF = True
X_FRAME_OPTIONS = 'DENY'
SESSION_COOKIE_HTTPONLY = True
CSRF_COOKIE_HTTPONLY = True
SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY')
if not SECRET_KEY:
raise ImproperlyConfigured('DJANGO_SECRET_KEY required')
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.Argon2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
]

SQL Injection Prevention

python
# GOOD: Django ORM automatically escapes
User.objects.filter(email__iexact=email)
# GOOD: Parameterized raw queries
User.objects.raw('SELECT * FROM users WHERE username = %s', [query])
# BAD: Never interpolate user input
User.objects.raw(f'SELECT * FROM users WHERE username = {username}')

Custom Permissions (DRF)

python
class IsOwnerOrReadOnly(permissions.BasePermission):
def has_object_permission(self, request, view, obj):
if request.method in permissions.SAFE_METHODS:
return True
return obj.author == request.user

API Rate Limiting

python
REST_FRAMEWORK = {
'DEFAULT_THROTTLE_CLASSES': [
'rest_framework.throttling.AnonRateThrottle',
'rest_framework.throttling.UserRateThrottle'
],
'DEFAULT_THROTTLE_RATES': {
'anon': '100/day',
'user': '1000/day',
}
}

Quick Security Checklist

CheckDescription
DEBUG = FalseNever in production
HTTPS onlyForce SSL, secure cookies
Strong secretsEnvironment variables for SECRET_KEY
CSRF protectionEnabled by default, don't disable
XSS preventionAuto-escapes, don't use `safe` with user input
SQL injectionUse ORM, never concatenate strings
Rate limitingThrottle API endpoints
Security headersCSP, X-Frame-Options, HSTS

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/romankovsv/claude-code-python-devops-mlops/django-security/badge)](https://verified-skill.com/skills/romankovsv/claude-code-python-devops-mlops/django-security)

Something wrong with this skill or its page? Tell us.