2

Disclaimer: I'm not an expert in requests.

I changed server of my Django project and I believe that because of the CSRF protection I get a Server Error (500):

Server Error (500)

This only happens if I have a cookie stored from the previous server. If I open an incognito tab or delete my cookies the problem gets solved.

However what if a server change is needed in a production site? It's not possible all the users delete their cookies.

Therefore if I understand correctly and it's indeed the CSRF, how can I reset the user cookie if the Django sends a 500 error so as the user gets redirected to the homepage instead of receiving the above error?

Is it a correct way of solving the problem?

Diolor
  • 13,181
  • 30
  • 111
  • 179
  • I'm' afraid I can't answer your question but to make sure that it is CSRF perhaps you can disable it as described here: http://stackoverflow.com/a/11374627/1068167 – span Dec 13 '13 at 13:43
  • I would suggest temporarily enabling debugging (`DEBUG = True`) to get some more info about the 500. Then we'll have more clues. – Rob L Dec 13 '13 at 14:18

0 Answers0