I want my Flask Blueprint to always run the method before executing any routes. Instead of decorating every route method in my project with a special decorator, I want to be able to do something like this:
def my_method(): do_stuff section = Blueprint('section', __name__)
Then basically both /section/one and /section/two will run my_method() before executing the code in route_one() or route_two() .
Is there any way to do this?
source share