views下导入方法
from django.views.decorators.csrf import csrf_exempt,csrf_protect
csrf_exempt是全局需要,唯独这个不需要
csrf_protect是全局不需要,唯独这个需要
使用方法:
from django.shortcuts import render,HttpResponse
from django.views.decorators.csrf import csrf_exempt

@csrf_exempt
def server(request):
    print(request.POST)
    return HttpResponse('已收到')

  

 



相关文章:

  • 2022-03-05
  • 2021-05-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
  • 2022-02-18
  • 2018-04-10
  • 2021-12-02
相关资源
相似解决方案