require_http_methods(request_method_list)
[source]
Decorator to require that a view only accepts particular request methods. Usage:
from django.views.decorators.http import require_http_methods @require_http_methods(["GET", "POST"]) def my_view(request): # I can assume now that only GET or POST requests make it this far # ... pass
Note that request methods should be in uppercase.
Please login to continue.