Flask - pass variables to templates


Flask Tip - Jinja Templates

You can pass variables as arguments to render_template() to use those variables in a template file.

👇

# app.py
@app.route('/about')
def about():
    return render_template('about.html', organization='TestDriven.io')


# about.html
<h2>Course developed by {{ organization }}.</h2>