Flask 3 · Templates, sessions and config
Render a template
Render templates/index.html with variables. Jinja escapes values by default.
return render_template("index.html", title="Home", posts=posts)
Official Flask 3 documentation
More templates, sessions and config commands
- Loop in a template
- Share a layout
- Link to a static file
- Remember a user between requests
- Load configuration
- Show a one-time message
All templates, sessions and config commands · Flask 3 cheatsheet