Back to Cookiecutter

Customizing the Jinja2 environment

docs/advanced/jinja_env.rst

2.7.1500 B
Original Source

.. _jinja-env:

Customizing the Jinja2 environment

The special template variable _jinja2_env_vars can be used to customize the Jinja2 environment.

This example shows how to control whitespace with lstrip_blocks and trim_blocks:

.. code-block:: JSON

{
    "project_slug": "sample",
    "_jinja2_env_vars": {"lstrip_blocks": true, "trim_blocks": true}
}