79822561

Date: 2025-11-17 16:58:33
Score: 1
Natty:
Report link

the crsf in @crsf_exempt stands for Cross site Request Forgery, this basically means that if you put this decorator, this is basically a cookie created so that clients that don't have a CSRF token can use the POST HTTP method, this also makes the view excluded from the Middleware protection

@csrf_exempt(your_view)

While @api_view on the other hand takes a list of supported methods in your view and if an unsupported one is called it handles the response instead of throwing an error

@api_view(http_method_names=['GET', 'POST', 'WHATEVER METHOD YOU WANT']
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @crsf_exempt
  • User mentioned (0): @api_view
  • Low reputation (1):
Posted by: TheGoat SamadhiFire