CBV:
第一种方式
@method_decorator(csrf_exempt)
def dispatch(self, request, *args, **kwargs):
return super(NodeGroups, self).dispatch(request,*args,**kwargs)
第二种方式
@method_decorator(csrf_exempt,name='dispatch')
class ps(View):
FBV
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def xxx(request):
浙公网安备 33010602011771号