Python webapp2: redirect back

梦想的初衷 提交于 2019-12-21 20:48:52

问题


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:


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)


来源:https://stackoverflow.com/questions/10889236/python-webapp2-redirect-back

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!