I just started with Google App Engine using python and I was following a tutorial and writing my own little app to get familiar the webapp framework. Now I just noticed the tutorial does the following self.redirect('/'). So that got me wondering: is there a way to redirect to a handler instead of a hardcoded path? Thought that might be better so that you can change your urls without breaking your app.
I just started with Google App Engine using python and I was following a
Share
One alternative would be to have a map of symbolic names to URLs, that way you could redirect to the mapped URL – you could then update your URLs with impunity.
Or if you’d rather just execute the code from another handler, I don’t know why you couldn’t just make a method call – worst case, you could extract a common method from the two handlers and call that.