0

I know this issue has been brought up countless times but all of the answers that I have found are for things I'm already including.

Some users are having issues using the registration form on my page, but not everyone. They are getting the CSRF token missing or incorrect error.

I'm using {% csrf_token %} inside of my form, I'm using the CSRF middleware and I'm using RequestContext (I'm actually using TemplateResponseMixin.render_to_response, but from my understanding that takes care of wrapping the passed dictionary in RequestContext). I've also had a user experiencing the issue send me a copy of the page source and the hidden input was included inside the form.

I'm assuming that since this doesn't happen every time, it's due to an incorrect CSRF token instead of a missing one? If that is the case, what could possibly be causing this, and what measures could I take to prevent it from happening?

The same user after trying again multiple times was eventually able to get the form submission to work as well.

Thanks in advance for your help!

2
  • It is an elaborate process to register? Things might be timing out. Jul 15, 2014 at 15:39
  • @SimeonVisser nope, it's a simple ModelForm with 10 or so fields with pretty simply validation. One regular expression check and that's about it. I'm not sure if this is related or not, but before pushing that form live I made that area of the site https and kept the rest http. Could it be because half of my site is http and this portion is https only? The rest of my site doesn't have any forms though. Jul 15, 2014 at 17:05

0

Your Answer

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

Browse other questions tagged or ask your own question.