Django Security
Follow these practices to protect your Django application.
Essential Settings
# settings.py for production
DEBUG = False
ALLOWED_HOSTS = ['yourdomain.com']
SECURE_SSL_REDIRECT = True
CSRF_COOKIE_SECURE = True
SESSION_COOKIE_SECURE = True
SECURE_HSTS_SECONDS = 31536000
Additional Security
- Use django-csp for Content Security Policy
- Enable rate limiting
- Validate all user input
Discussion 0
No comments yet. Be the first to start the discussion!
Leave a Comment