-1

While the site loads smoothly through the browser,but when i send a POST request via postman or a REST API client, i am getting a csrf error.

"CSRF cookie not set."

IS THERE A WAY TO SEND A REQUEST SKIPPING CSRF?

Community
  • 1
  • 1
alien
  • 51
  • 1
  • 7
  • 1
    Possible duplicate of [Django CSRF Cookie Not Set](https://stackoverflow.com/questions/17716624/django-csrf-cookie-not-set) – Enrico Lund Feb 07 '18 at 11:27
  • Duplicate question https://stackoverflow.com/questions/17507206/how-to-make-a-post-simple-json-using-django-rest-framework-csrf-token-missing-o – Sakthi Panneerselvam Feb 07 '18 at 11:27

1 Answers1

1

You need to use csrf_exempt decorator on your view : this will disable the check of the csrf token

https://docs.djangoproject.com/en/2.0/ref/csrf/#django.views.decorators.csrf.csrf_exempt

Gabriel Samain
  • 439
  • 3
  • 10