def wrapper_name(func):

    def wrapper(*args, **kwargs):
        rv = func(*args, **kwargs)
return rv
wrapper.__name__ = func.__name__
return wrapper

@app.route('/foo')
@wrapper_name
def foo():
    return 'This gets passed to rv'
Python Flask after_request и before_request для определенного набора запросов