See the answers below for a better solution. Since I wrote this, a lot has changed. Now there are better ways to disable CSRF.
I feel your pain. It is not acceptable for a framework to change such fundamental functionality. Even if I want to start using it from now on, I have outdated sites on the same computer where there is a copy of django. Changes like this require a revision of the version number. 1.x → 2.x.
Anyway, to fix this, I just commented on it and stopped updating Django so often.
File: django / middleware / csrf.py Along line 160:
# check incoming token # request_csrf_token = request.POST.get('csrfmiddlewaretoken', None) # if request_csrf_token != csrf_token: # if cookie_is_new: # # probably a problem setting the CSRF cookie # return reject("CSRF cookie not set.") # else: # return reject("CSRF token missing or incorrect.")
Aaron Mar 12 2018-10-12T00: 00Z
source share