您的位置:首页 > 编程语言 > Go语言

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

2012-05-29 10:15 591 查看
在注销登录完以后,要把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

return render(request,'index.html')


原文网址:/article/4117597.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: