Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
应用程序引擎和python。如何前往辅道_Python_Google App Engine - Fatal编程技术网

应用程序引擎和python。如何前往辅道

应用程序引擎和python。如何前往辅道,python,google-app-engine,Python,Google App Engine,我知道用户。create_logout('example')可以将用户指向当前路径下的路径。像/main/example/,但是如果我想将用户引导到示例的子路径,比如/main/example/example1,我该怎么做呢?非常感谢医生说: 创建注销url(目的地url) 退换商品 一个URL,当被访问时,它会在 用户退出,然后将用户重定向回 指向作为dest_URL给定的URL。此URL 适用于链接、按钮和 重定向。dest_url可以是完整url或 相对于应用程序的路径 域名 …因此您可以

我知道
用户。create_logout('example')
可以将用户指向当前路径下的路径。像
/main/example/
,但是如果我想将用户引导到示例的子路径,比如
/main/example/example1
,我该怎么做呢?非常感谢

医生说:

创建注销url(目的地url)
退换商品 一个URL,当被访问时,它会在 用户退出,然后将用户重定向回 指向作为dest_URL给定的URL。此URL 适用于链接、按钮和 重定向。dest_url可以是完整url或 相对于应用程序的路径 域名

…因此您可以将任何完整路径或相对路径作为参数,如:

 users.create_logout_url('/home/example/example1')
URL只是一个字符串,因此您可以这样做(在下面的附加注释之后):


嘿,谢谢你先回复我,但我忘了详细说明我的问题,我希望我的子路径是/main/example/john或/main/example/joe之类的,子路径可以在用户登录后根据用户帐户进行更改。谢谢你谢谢你!!!那有帮助!顺便说一句,我所做的是用户。创建\u注销\u url(“/home/example/”+currentUser.昵称())是同一件事吗?应该创建完全相同的字符串,是的。顺便说一句,在我将用户引导到他们的页面后,比如/example/john,我如何使webapp.requesthandler处理此页面的请求?如果我这样做('/user.*',UsersSubPath)匹配/user/之后的所有页面,如果我这样做('/user/user.name*',UsersSubPath),那也不起作用,因为它不能自动用用户名替换user.name。再次感谢您接受此答案,并为该部分创建一个新问题。
currentUser = users.get_current_user()
logoutUrl = users.create_logout_url("/home/example/%s" % currentUser.nickname())