About Suspicious Operations

Raise SuspiciousOperation if you find some views not being used as designed (forms tempered, parameters missing, headers messed up, etc.):

1
2
3
4
5
6
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