in php there is
header('Refresh: 1;url=destination');
which redirects the client to a given url, and while it must be called before anything else, it allows me to display something else after that line.
In Flask + python which I am practicing, there is
return redirect(destination, code=301)
which also redirects, but isn't able to do anything else, like displaying further code to the client as PHP can do.
If I'm not wrong, both functions send an header which says to the client to go to another location, but they behave differently: in the first case it is sent while providing an answer; in the second case, it is the answer.
I'd like to have the same (php) function in Flask but after reading the docs, I guess there isn't a way to serve a redirect together with some content.