2

I have an ASP.NET Mvc application which will send a POST request to my Django website. Now I am getting CSRF verification failed. Request aborted.. How can I disable it.

0

1 Answer 1

4

Use @csrf_exempt decorator:

from django.views.decorators.csrf import csrf_exempt

@csrf_exempt
def my_view(request):
    ...
Sign up to request clarification or add additional context in comments.

7 Comments

Thanks. But I am getting MultiValueDictKeyError when I do request.POST['rml']
This error is thrown then there is no such parameter in POST data. Use request.POST.get('rml') instead.
@warath-coder, its just a def and request.POST.get. Please try it
it works perfectly fine for me; why i ask to see your exact code; the form as well that is sending the POST data.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.