小编Jes*_*ent的帖子

Google应用引擎重定向到绝对的uri

我正在使用谷歌应用程序引擎与python和webapp2,我找不到只是使用绝对uri重定向到外部网站的方式.

例如:

class Landing(BaseHandler):
    def get(self):     
        self.render("landing.html")

    def post(self):
        name=self.request.get("name")
        if name == "yes"
            self.redirect("/")
        else:
            self.redirect("http://example.com") **This is the problem as I want to redirect to an absolute url.
Run Code Online (Sandbox Code Playgroud)

self.redirect始终重定向到相对URL.我怎么能重定向到绝对URL?我认为它必须容易,但我找不到方法.

google-app-engine redirect

5
推荐指数
1
解决办法
686
查看次数

标签 统计

google-app-engine ×1

redirect ×1