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):
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?