@ratelimit(key='ip', rate='5/m', block=False)
def myview(request):
# Will be true if the same IP makes more than 5 POST
# requests/minute.
was_limited = getattr(request, 'limited', False)
return HttpResponse()
In my understanding by default method is ALL, so while 5 POSTs will trigger the rate limiting, so would any other request methods.
The first example comment seems to be only partially correct: https://github.com/jsocol/django-ratelimit/blob/main/docs/usage.rst?plain=1#L84:
In my understanding by default
method
isALL
, so while 5POST
s will trigger the rate limiting, so would any other request methods.