如果只需要一些视图不使用CSRF,可以使用@csrf_exempt:

 

 

from django.views.decorators.csrf import csrf_exempt

@csrf_exempt
def my_view(request):
    return HttpResponse('Hello world')

相关文章:

  • 2021-08-15
  • 2021-07-30
  • 2021-08-29
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-05
  • 2022-12-23
  • 2022-01-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-02
相关资源
相似解决方案