The normal way of sending data to HTML that I know of is
data = ['a','b','c']
return render_template('index.html', my_data=data)
However, say I have 10+ routes that I have to keep track of, is there a more efficient way to globally send data
to every route without having to explicitly say so in every instance of render_template()
?
The reason for this is I have used Auth0 to create the login, now I have the user_info which contains their name and display picture, etc, this gets stored in the session['profile']
. It'd be nice to send this information to every route so that I can display
IMG | Username | [log out]
In the Navbar on every page, without having to include it in the render template method every time for every instance. Is there something like this?