python - Redirect to a Page on 404 Error -


is possible redirect page on 404 , 500 instead of constructing custom response? tried-

class notfoundpagehandler(webapp.requesthandler):     def get(self):                 #if 400         self.redirect('error/notfound.html')         #if 500 how check  def main():     application = webapp.wsgiapplication(                                        [                                          ('/', mainpage),                                          ('/index.html', mainpage),                                          ('.*', notfoundpagehandler)                                        ], debug=true) 

but doesn't work.

you don't want redirect. want custom error page.

http://code.google.com/appengine/docs/python/config/appconfig.html#custom_error_responses

error_handlers:   - file: default_error.html    - error_code: over_quota     file: over_quota.html 

- error_code: 404 or - error_code: 500 should work too. read link carefully, sounds have careful files aren't in static file directory.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -