Search code examples
google-app-enginepython-2.7webapp2

Temporary page while redirect on google app engine


I want to create a temporary page where the browser lingers for a few seconds and is then redirected to another page. Working on python on Google App Engine. I thought the below should work(I am a total novice at this) but clearly it doesn't.

class TempPage(PageHandler):
        def get(self):
                self.response.write("You will be redirected to the Front page.")
                time.sleep(3)
                self.redirect('/')

PageHandler inherits from webapp2.RequestHandler.

Can someone please tell me what should be done.

Thanks


Solution

  • I think that you want to use the meta refresh tag. There are some examples on that page, but you basically add a tag that looks like:

    <meta http-equiv="refresh" content="TIME_TO_WAIT;URL='PAGE_TO_REDIRECT_TO'">
    

    and put that in your <head> tag.