11 lines
285 B
Python
11 lines
285 B
Python
from __future__ import annotations
|
|
|
|
from django.conf import settings
|
|
from django.utils.deprecation import MiddlewareMixin
|
|
|
|
|
|
class DisableCSRFCheck(MiddlewareMixin):
|
|
def process_request(self, request):
|
|
if settings.DEBUG:
|
|
request._dont_enforce_csrf_checks = True
|