0
目前我有foo.com/bar路由到請求處理程序Main。我也希望foo.com/bar/id路由到該請求處理程序(其中「id」是一個對象的id)。如何使用WSGIApplication()路由特定路徑?
這裏是我試過,但它的失敗:
application = webapp.WSGIApplication(
[('/bar', MainHandler),
(r'/bar/(.*)', MainHandler)],
debug=True)
我得到的錯誤是:
TypeError: get() takes exactly 1 argument (2 given)
謝謝,這是有效的。我不明白爲什麼我需要在這種情況下的變種。是因爲我使用正則表達式嗎? – 2010-12-21 20:53:18