Flask G variable Simple example
<p>From what i understand a g variable is a temporary storage that last from one single request to the other. For example i was thinking it should work like this. But i can't get it to work.</p>

<pre class="lang-py prettyprint-override"><code>from flask import Flask, g, redirect, url_for
app = Flask(__name__)

@app.route('/')
def hello_world():
    g = "hello world"
    return redirect(url_for('test'))

@app.route('/test')
def test():
    return str(g)

if __name__ == "__main__":
    app.run(debug=True)
</code></pre>