Django 补充

 

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

 

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

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

csrf_protect 只让这一个校验


csrf_token校验在process_view中做校验的

 

posted @ 2018-07-23 22:19  可爱的红领巾  阅读(83)  评论(0)    收藏  举报