我在我的主应用程序中有以下代码.我希望除了前两个之外的所有路径都被最后一个路由(/.*)捕获.但我得到404错误.我错过了什么? import webapp2 from webapp2 import WSGIApplication, Route # ---- main
          import webapp2
  from webapp2 import WSGIApplication, Route
  # ---- main handler
  class MainPage(webapp2.RequestHandler):
    def get(self):
      ret = jinja2render.DoRender(self)
      return ret
  routes = [
    Route (r'/rpc', handler = 'rpc.RPCHandler'),
    Route (r'/secured/somesecuredpage', handler = 'secured.securedPageHandler'),
    Route (r'/.*', handler = MainPage),
  ]
  app = WSGIApplication(routes, debug=True) 
 我可以从“/”更改最后一条路线. to“/\u0026lt;:.\u0026gt;”捕获所有其他路径,但这也要求我在MainPage.get函数中包含一个命名参数.这是唯一的办法,还是我错过了什么?谢谢.
根据 URI template docs,这应该做的伎俩:Route (r'/<:.*>', handler=MainPage)
您可能需要按如下方式定义MainPage.get方法以接受额外的参数:
def get(self, *args, **kwargs):
