I am working with Flask 0.9. I have experience with Google App Engine.
In GAE, the url match patterns are evaluated in the order they appear, first come first s
This works for your second issue.
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'This is the front page'
@app.route('/hello/')
def hello():
return 'This catches /hello'
@app.route('/')
@app.route('/<path:dummy>')
def fallback(dummy=None):
return 'This one catches everything else'
path
will catch everything until the end. More about the variable converters.
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