.. _templating: Templates ========= Quart uses the `Jinja `_ templating engine, which is well `documented `_. Quart adds a standard context, and some standard filters to the Jinja defaults. Quart also adds the ability to define custom filters, tests and contexts at an app and blueprint level. There are two functions to use when templating, :func:`~quart.templating.render_template` and :func:`~quart.templating.render_template_string`, both must be awaited. The return value from either function is a string and can form a route response directly or be otherwise combined. Both functions take an variable number of additional keyword arguments to pass to the template as context, for example, .. code-block:: python @app.route('/') async def index(): return await render_template('index.html', hello='world') Quart standard extras --------------------- The standard context includes the ``config``, ``request``, ``session``, and ``g`` with these objects referencing the ``current_app.config`` and those defined in :mod:`~quart.globals` respectively. The can be accessed as expected, .. code-block:: python @app.route('/') async def index(): return await render_template_string("{{ request.endpoint }}") The standard global functions are :func:`~quart.helpers.url_for` and :func:`~quart.helpers.get_flashed_messages`. These can be used as expected, .. code-block:: python @app.route('/') async def index(): return await render_template_string("