[Flask] Sharing a variable to all HTML pages

John Robson John.Robson at usp.br
Thu Jul 14 01:51:44 EDT 2016


Hi everyone,

I would like to pass several variables to all HTML pages, how can I send 
a variable to all HTML pages, without pass it all the time through 
"*render_template*"? eg: sending "time" to all HTML pages

/*site.html*/*
**Last Update: {{ update }}**
**
*/*app.py*/*
**  update = '2016-07-14 01:37:56'**
**  return render_template('site.html', _update=update_)*

But how to pass this value every time to all HTML pages automatically? Just:
* return render_template('site.html')*

And the value 'update' will be there.

Thank you for helping,
John

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20160714/3b2b57a6/attachment.html>


More information about the Flask mailing list