You need to register a catch-all script handler. Append this at the end of your app.yaml:
- url: /.*
script: main.py
In main.py you will need to put this code:
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class NotFoundPageHandler(webapp.RequestHandler):
def get(self):
self.error(404)
self.response.out.write('<Your 404 error html page>')
application = webapp.WSGIApplication([('/.*', NotFoundPageHandler)],
debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()
Replace <Your 404 error html page>
with something meaningful. Or better use a template, you can read how to do that here.
Please let me know if you have problems setting this up.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…