I have the following code in the main application. I expect all paths other than the first two to be caught by the last route (/.*). But I get error 404. What am I missing?
import webapp2
from webapp2 import WSGIApplication, Route
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)
I can change the last route from "/". to "/ <:.>" to catch all the other paths, but also requires me to include the named parameter in the MainPage.get function. Is this the only way to do it, or am I missing something? Thanks.
source
share