Add to your middleware classes before 'django.middleware.csrf.CsrfViewMiddleware'.
1 2 3 | class IgnoreCsrfMiddleware(object):
def process_request(self, request):
request.csrf_processing_done = True
|
More like this
- Image compression before saving the new model / work with JPG, PNG by Schleidens 1 week, 3 days ago
- Help text hyperlinks by sa2812 1 month, 1 week ago
- Stuff by NixonDash 3 months, 1 week ago
- Add custom fields to the built-in Group model by jmoppel 5 months, 2 weeks ago
- Month / Year SelectDateWidget based on django SelectDateWidget by pierreben 9 months ago
Comments
Works great - to clarify you add it like so (in settings.py):
#
If you are going to ignore the csrf why adding the middleware in the first place?
#
Please login first before commenting.