美文网首页
django ,ajax post 报错 "csrf token

django ,ajax post 报错 "csrf token

作者: warmi_ | 来源:发表于2018-11-23 17:16 被阅读0次

    views.py中:

    from django.views.decorators.csrf import csrf_exempt
    @csrf_exempt
    def post_method(request):
      pass
    

    去跳过 csrf 中间件的保护,html中就不用加csrf相关的东西了

    相关文章

      网友评论

          本文标题:django ,ajax post 报错 "csrf token

          本文链接:https://www.haomeiwen.com/subject/gxtsqqtx.html