Thursday, August 25, 2016

Different values for csrfmiddlewaretoken and csrftoken causing 403 errors in Django admin

Hi, I am trying to debug some 403 errors I am getting in the Django admin. When I have debug set to true, everything works fine, but when I have it set to false, I get a 403 CSRF verification failed response.  This is a superuser account which has all permissions so it shouldn't be related to that. 

I noticed that the csrfmiddlewaretoken and csrftoken values are always different, so I am wondering if that is why it is failing and any recommendations for how to debug what is causing this to happen? 

In case it's relevant, this project was working fine Django 1.4.6 for a long time, and I recently upgraded it to 1.9.9 which is when I started seeing these errors.

Any advice or tips for debugging this would be appreciated! Thank you

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/47740554-d308-4823-bbb9-4d54627c4158%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment