Can Flask have optional URL parameters?
Almost the same as Audrius cooked up some months ago, but you might find it a bit more readable with the defaults in the function head - the way you are used to with python:
@app.route('/<user_id>')@app.route('/<user_id>/<username>')def show(user_id, username='Anonymous'): return user_id + ':' + username