How to use g.user global in flask
As I understand the g variable in Flask, it should provide me with a global place to stash data like holding the current user after login. Is this correct? I would like my navigation to display my user's name, once logged in, across the site. My views contain from Flask import g #among other things During login, I assign user = User.query.filter_by(username = form.username.data).first() if validate(user): session['logged_in'] = True g.user = user It doesn't seem I can access g.user. Instead, when my base.html template has the following... <ul class="nav"> {% if session['logged_in'] %} <li