from django.views.decorators.csrf import csrf_exempt
@csrf_exempt # 前端ajax请求时需要验证,否则403
def fun(request):
if request.method == 'POST': # 请求方式时Post则响应
HttpResponse('ok')
django-csrf_exempt
猜你喜欢
转载自www.cnblogs.com/tangpg/p/9116869.html
今日推荐
周排行