Python webapp2: redirect back

2019-04-12 04:28发布

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

1条回答
聊天终结者
2楼-- · 2019-04-12 05:22

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)
查看更多
登录 后发表回答