django 后端禁用csrf

2022-02-23  本文已影响0人  Aedda
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt


@method_decorator(csrf_exempt, name='dispatch')
class ViewRPALogin(View):
    def post(self, request):
from django.views.decorators.csrf import csrf_exempt


@csrf_exempt
def dasd(request):
    pass
from django.views.decorators.csrf import csrf_exempt


class ViewRPALogin(View):
    @csrf_exempt
    def post(self, request):
上一篇下一篇

猜你喜欢

热点阅读