from django.views.decorators.csrf import csrf_exempt @csrf_exempt # 前端ajax请求时需要验证,否则403 def fun(request): if request.method == 'POST': # 请求方式时Post则响应 HttpResponse('ok')
posted on 2018-05-31 15:13 阅读( ...) 评论( ...)
本文共 269 字,大约阅读时间需要 1 分钟。
from django.views.decorators.csrf import csrf_exempt @csrf_exempt # 前端ajax请求时需要验证,否则403 def fun(request): if request.method == 'POST': # 请求方式时Post则响应 HttpResponse('ok')
转载于:https://www.cnblogs.com/tangpg/p/9116869.html