Django之CSRF验证。

@csrf_exempt(免除csrf验证)

from django.views.decorators.csrf import csrf_exempt


@csrf_exempt
def index(request):
if request.method == 'GET':
return HttpResponse('GET请求')
elif request.method == 'POST':
return HttpResponse('POST请求')

https://www.cnblogs.com/qq2233297039/articles/8646511.html

posted @ 2020-05-28 17:09  hanfe1  阅读(111)  评论(0编辑  收藏  举报