Python webapp2:重定向回来 [英] Python webapp2: redirect back

查看:188
本文介绍了Python webapp2:重定向回来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



这种情况很简单:我点击注销,我想让我的注销处理程序将我重新导向回到我从哪里来的网页。



我如何实现这一目标?
thnx

解决方案

建立注销网址,你可以传递你想要用户重定向到的url,在你的情况下,他的当前网址。像这样的东西(我不是Python开发人员,所以...):

$ p $ users.create_logout_url(self.request.url )


I'm using the google app engine for a basic app.

The scenario is simple: i click Logout and I want my Logout handler to redirect me back to the page from where I came from.

How do I achieve this? thnx

解决方案

When creating logout url you can pass in the url you want user to be redirected to, in your case his current url. Something like this (I'm not Python dev, so ...):

users.create_logout_url(self.request.url)

这篇关于Python webapp2:重定向回来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆