GAE redirection with a delay

后端 未结 2 1914
走了就别回头了
走了就别回头了 2021-01-15 17:52

Is that possible to redirect to another url with a delay in GAE? I know I can use JavaScript for this purpose, but may be there is a way to do delayed redirection without it

2条回答
  •  不思量自难忘°
    2021-01-15 18:29

    import time at the top of your module and do a time.sleep(0.5) before you do a self.redirect call. The sleep argument can take a floating point value of number of seconds to delay. Just make sure that you don't exceed 30 seconds of delay as GAE expects that every request be handled within that otherwise it will be interrupted.

提交回复
热议问题