梦见世界

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

网址链接:https://docs.djangoproject.com/en/1.8/ref/csrf/

1. 在使用csrf中间件时免除csrf:用装饰器

from django.views.decorators.csrf import csrf_exempt

  @csrf_exempt

2.不用csrf中间件是使用csrf:用装饰器

from django.views.decorators.csrf import csrf_protect

@csrf_protect

 

posted on 2015-08-21 16:47  梦见世界  阅读(323)  评论(0编辑  收藏  举报