django - 任何预建的身份验证信号接收器?
我正在编写一个自定义注销视图,因为 Django 内置注销函数在调用 request.session.flush() 时会清除所有会话。即使用户已注销,我也想保留一些会话变量。
我想用一个信号来通知所有网站我已经注销了。 Django 1.2.4 身份验证系统是否有任何内置信号接收器可以发送信号,以便网站上的其他页面将“通知”我已注销?
I'm writing a custom logout view since the Django built in logout function wipes out all the sessions when it calls the request.session.flush(). I have some sessions variables that I would like to keep even though the user has logged out.
I was thinking to use a signal to notify all the web site that I've logged out.
Does the Django 1.2.4 authentication system have any built signal receivers to send a signal to so the other pages on the web site will be "informed" that I've logged out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,Django 1.2.4 不提供身份验证信号,但它们被添加到 trunk 中,因此下一个版本可能会包含它们。
http://docs.djangoproject.com/en /dev//topics/auth/#login-and-logout-signals
No, Django 1.2.4 doesn't provide authentication signals, but they were added in trunk, so the next release probably will include them.
http://docs.djangoproject.com/en/dev//topics/auth/#login-and-logout-signals