rendertemplate("page.html", context) renders files from the templates/ folder with Jinja2. Output is auto-escaped in .html templates, which protects against XSS. Jinja2 cheat sheet Syntax Purpose {{ user.name }} print an expression {% if %} … {% endif %} conditionals {% for x in items %} … {% else %} … {% endfor %} loops (with empty fallback) {{ price \ round(2) }}, \ upper, \ default("—") filters {% extends "base.html" %} + {% block content %} layout inheritance {% include "nav.html" %} partials {{ urlfor('static', filename='app.css') }} static asset links Keep logic in Python and pass ready-to-display data to the template.