About Suspicious Operations
Raise SuspiciousOperation
if you find some views not being used as designed (forms tempered, parameters missing, headers messed up, etc.):
from django.core.exceptions import SuspiciousOperation
def webhook(request):
if request.method == "DELETE":
raise SuspiciousOperation("Hacking attempt detected.")
...
Tips and Tricks Programming Security Django 4.2 Django 3.2 Django 2.2
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.