0
在帶有Google webapp框架的Google App Engine應用程序中,如何將每個請求重定向到一個處理程序?將所有url請求重定向到一個處理程序
檢查這個代碼:
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class MainPage(webapp.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write('Hello, webapp World!')
application = webapp.WSGIApplication([('/', MainPage)],
debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()
我怎樣才能改變application = webapp.WSGIApplication([('/', MainPage)], debug=True)
線到所有的請求重定向而不是隻有/
。我試過了,並且*
和/*
它不起作用。
它的工作原理。謝謝! –