📜  为一个 url django 禁用 csrf - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:44.596000             🧑  作者: Mango

代码示例1
from django.views.decorators.csrf import csrf_exempt

@csrf_exempt
def xyx(request):
  #your code
  
#this makes the function accept post request without csrf token
#use it just for quick check or for operations where csrftoken authentication
#isn't required