2011-12-08 9 views
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) 라인을 변경할 수 있습니다. 나 시도하고 */* 및 작동하지 않습니다.

답변

5

application = webapp.WSGIApplication([('/.*', MainPage)], ...

+0

작동합니다. 고맙습니다! –

관련 문제