0
是否有一種(簡單)的方式來構建webapp2的url的方式,將允許像下面的結構?我看不到從父級傳遞PathPrefixRoute的方法,但類似PathPrefixRoute('(/v1)', [PathPrefixRoute('$1/app1',
會很酷。python webapp2嵌套PathPrefixRoute
urls = [
PathPrefixRoute('/v1', [
PathPrefixRoute('/app1', [
# /v1/app1/index
Route('/index', 'v1.app1.index.Main')
]),
PathPrefixRoute('/app2', [
# /v1/app2/index
Route('/index', 'v1.app2.index.Main')
])
]),
PathPrefixRoute('/v2', [
PathPrefixRoute('/app1', [
# /v2/app1/index
Route('/index', 'v2.app1.index.Main')
])
])
]
application = webapp2.WSGIApplication(routes=urls)