1

I have a function in my controller that take an HTTP GET request. On certain argument values of that request I want to raise a 404. I also want that 404 to get rerouted to a different html page that I can make instead of giving that generic

404 NOT FOUND

or whatever with a message. I made a routes.py which is in the root directory of my application and it contains

routes_onerror[('myapp/404', 'myapp/static/404.html')]

And I also have a 404.HTML in my static folder. Is what I am trying to do the intended use of routes?

4

1 回答 1

1

Missing an =, and the URL should be preceded by a /:

routes_onerror = [('myapp/404', '/myapp/static/404.html')]
于 2013-06-27T20:09:50.457 回答