Django 补充

from django.views.decorators.csrf import  csrf_exempt,csrf_protect

两个装饰器可以让你的 视图函数可以校验或者不校验csrf_token

csrf_exempt 只让这个某一个函数不校验csrf_token

csrf_protect 只让这一个校验


csrf_token校验在process_view中做校验的

猜你喜欢

转载自www.cnblogs.com/zhaoyunlong/p/9357285.html