Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python webapp2: redirect back

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

like image 220
Calin Paul Alexandru Avatar asked Feb 19 '26 07:02

Calin Paul Alexandru


1 Answers

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)
like image 186
Peter Knego Avatar answered Feb 20 '26 21:02

Peter Knego



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!