In Flask, how could I run a function after returning a response for a particular route? For example:
# This function takes a long time to run
def long_func():
...
@app.route('/')
def index():
...
return response
If I wanted to run long_func after returning the response for only the index route, how could I do that?