Saturday, June 23, 2012

403 error when POSTing to a view with csrf protection

I realized that I was heading down the wrong track with my previous message to this mailing list so I studied the problem some more.  Now I am trying to send a POST request to a view and it gets rejected with a 403 error.  when I disable the csrf requirement using the @csrf_exempt decorator, the view works as expected.  the csrf token is being passed in the POST request, so I don't understand why else the request fails.  Any ideas?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/DDIIvexJoLMJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment