Flask URL Route: Route All other URLs to some function

前端 未结 2 597
刺人心
刺人心 2021-02-04 07:38

I am working with Flask 0.9. I have experience with Google App Engine.

  1. In GAE, the url match patterns are evaluated in the order they appear, first come first s

2条回答
  •  我寻月下人不归
    2021-02-04 08:14

    1. I think this is the answer http://flask.pocoo.org/docs/design/#the-routing-system
    2. If you need to handle all urls not found on server — just create 404 hanlder:

      @app.errorhandler(404)
      def page_not_found(e):
          # your processing here
          return result
      

提交回复
热议问题