Reputation: 12318
In a Google App Engine application with google webapp framework, how do I redirect every request to one handler?
Check this code:
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()
How can i change the application = webapp.WSGIApplication([('/', MainPage)], debug=True)
line to redirect all the requests instead only the /
. I tried and *
and /*
and it does not work.
Upvotes: 0
Views: 222
Reputation: 24956
application = webapp.WSGIApplication([('/.*', MainPage)], ...
Upvotes: 5