class DisableCSRFOnDebug(object):

    def process_request(self, request):
        if settings.DEBUG:
            setattr(request, '_dont_enforce_csrf_checks', True)
How to disable Django's CSRF validation?