why do you use csrf exempt code example
Example: csrf_exempt
#first you need to import this
from django.views.decorators.csrf import csrf_exempt
#now use @csrf_exempt dacorator as follows
@csrf_exempt
def exampleview(request):
pass
#now this view will not require csrf_token to handle post requests