Django用户登录中出现403问题的解决

在注销登录完以后,要把RequestContext传出去,这样才会有效果,不然会引发403
即使页面加了tag。
有问题的登出


def logout(request): user_logout(request) return render_to_response('index.html')

正确的代码

return render_to_response('index.html',context_instanse=RequestContext(request))

或者用django1.3新增的render
【Django用户登录中出现403问题的解决】
return render(request,'index.html')

    推荐阅读