A very fast and expressive template engine. (LADI project)
Go to file
David Lord aa3d688a15
Merge branch '2.10.x' into 2.11.x
2022-03-11 14:26:34 -08:00
.github Improve issue template 2017-01-09 17:37:18 +01:00
artwork documentation style updates, added print css 2008-05-06 12:14:23 +02:00
docs Merge branch '2.10.x' into 2.11.x 2022-03-11 14:26:34 -08:00
examples/basic Revert "rename imports to jinja" 2020-01-26 21:12:52 -08:00
ext/Vim remove old scripts and examples 2020-01-10 12:58:38 -08:00
scripts Revert "rename imports to jinja" 2020-01-26 21:12:52 -08:00
src/jinja2 release version 2.11.3 2021-01-31 08:44:37 -08:00
tests native only evals at end of render 2020-04-13 08:51:38 -07:00
.azure-pipelines.yml remove test and coverage results from ci 2020-01-26 22:21:08 -08:00
.gitignore don't finalize TemplateData nodes 2019-10-12 21:25:48 -07:00
.pre-commit-config.yaml add pre-commit config 2020-01-10 07:54:34 -08:00
.readthedocs.yaml use current jinja for docs build 2022-03-11 10:07:50 -08:00
CHANGES.rst release version 2.11.3 2021-01-31 08:44:37 -08:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2019-05-06 13:10:17 -04:00
LICENSE.rst standardize license 2019-07-17 08:01:46 -07:00
MANIFEST.in remove test and coverage results from ci 2020-01-26 22:21:08 -08:00
README.rst Revert "rename imports to jinja" 2020-01-26 21:12:52 -08:00
setup.cfg remove test and coverage results from ci 2020-01-26 22:21:08 -08:00
setup.py add python 3.8 classifier, clean up changelog 2020-01-26 22:24:57 -08:00
tox.ini remove test and coverage results from ci 2020-01-26 22:21:08 -08:00

README.rst

Jinja
=====

Jinja is a fast, expressive, extensible templating engine. Special
placeholders in the template allow writing code similar to Python
syntax. Then the template is passed data to render the final document.

It includes:

-   Template inheritance and inclusion.
-   Define and import macros within templates.
-   HTML templates can use autoescaping to prevent XSS from untrusted
    user input.
-   A sandboxed environment can safely render untrusted templates.
-   AsyncIO support for generating templates and calling async
    functions.
-   I18N support with Babel.
-   Templates are compiled to optimized Python code just-in-time and
    cached, or can be compiled ahead-of-time.
-   Exceptions point to the correct line in templates to make debugging
    easier.
-   Extensible filters, tests, functions, and even syntax.

Jinja's philosophy is that while application logic belongs in Python if
possible, it shouldn't make the template designer's job difficult by
restricting functionality too much.


Installing
----------

Install and update using `pip`_:

.. code-block:: text

    $ pip install -U Jinja2

.. _pip: https://pip.pypa.io/en/stable/quickstart/


In A Nutshell
-------------

.. code-block:: jinja

    {% extends "base.html" %}
    {% block title %}Members{% endblock %}
    {% block content %}
      <ul>
      {% for user in users %}
        <li><a href="{{ user.url }}">{{ user.username }}</a></li>
      {% endfor %}
      </ul>
    {% endblock %}


Links
-----

-   Website: https://palletsprojects.com/p/jinja/
-   Documentation: https://jinja.palletsprojects.com/
-   Releases: https://pypi.org/project/Jinja2/
-   Code: https://github.com/pallets/jinja
-   Issue tracker: https://github.com/pallets/jinja/issues
-   Test status: https://dev.azure.com/pallets/jinja/_build
-   Official chat: https://discord.gg/t6rrQZH