Suppose I have a simple route with a variable part:
@app.route(\'/post/\') def show_post(post_id): return \'Post %d\' % post_id
Use request.view_args:
@app.context_processor def provide_foo(): if "post_id" in request.view_args: post_id = request.view_args["post_id"] return {"bar": some_function(post_id)}