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
- Stuff by NixonDash 1 month ago
- Add custom fields to the built-in Group model by jmoppel 3 months, 1 week ago
- Month / Year SelectDateWidget based on django SelectDateWidget by pierreben 6 months, 3 weeks ago
- Python Django CRUD Example Tutorial by tuts_station 7 months, 1 week ago
- Browser-native date input field by kytta 8 months, 3 weeks 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.