• Home
Name Date Size #Lines LOC

..--

.github/03-May-2024-8776

artwork/03-May-2024-133131

docs/03-May-2024-4,1872,928

examples/basic/03-May-2024-140124

requirements/03-May-2024-9890

scripts/03-May-2024-7555

src/jinja2/03-May-2024-12,6099,734

tests/03-May-2024-7,1385,994

.editorconfigD03-May-2024217 1411

.gitignoreD03-May-2024166 2120

.pre-commit-config.yamlD03-May-2024714 2726

.readthedocs.yamlD03-May-2024131 98

Android.bpD03-May-20241,015 5450

CHANGES.rstD03-May-202430.8 KiB790638

CODE_OF_CONDUCT.mdD03-May-20243.3 KiB7757

CONTRIBUTING.rstD03-May-20246.2 KiB216140

LICENSE.rstD03-May-20241.4 KiB2923

MANIFEST.inD03-May-2024154 109

README.rstD03-May-20241.8 KiB6749

setup.cfgD03-May-2024786 4338

setup.pyD03-May-20241.4 KiB4137

tox.iniD03-May-2024440 2016

README.rst

1Jinja
2=====
3
4Jinja is a fast, expressive, extensible templating engine. Special
5placeholders in the template allow writing code similar to Python
6syntax. Then the template is passed data to render the final document.
7
8It includes:
9
10-   Template inheritance and inclusion.
11-   Define and import macros within templates.
12-   HTML templates can use autoescaping to prevent XSS from untrusted
13    user input.
14-   A sandboxed environment can safely render untrusted templates.
15-   AsyncIO support for generating templates and calling async
16    functions.
17-   I18N support with Babel.
18-   Templates are compiled to optimized Python code just-in-time and
19    cached, or can be compiled ahead-of-time.
20-   Exceptions point to the correct line in templates to make debugging
21    easier.
22-   Extensible filters, tests, functions, and even syntax.
23
24Jinja's philosophy is that while application logic belongs in Python if
25possible, it shouldn't make the template designer's job difficult by
26restricting functionality too much.
27
28
29Installing
30----------
31
32Install and update using `pip`_:
33
34.. code-block:: text
35
36    $ pip install -U Jinja2
37
38.. _pip: https://pip.pypa.io/en/stable/quickstart/
39
40
41In A Nutshell
42-------------
43
44.. code-block:: jinja
45
46    {% extends "base.html" %}
47    {% block title %}Members{% endblock %}
48    {% block content %}
49      <ul>
50      {% for user in users %}
51        <li><a href="{{ user.url }}">{{ user.username }}</a></li>
52      {% endfor %}
53      </ul>
54    {% endblock %}
55
56
57Links
58-----
59
60-   Website: https://palletsprojects.com/p/jinja/
61-   Documentation: https://jinja.palletsprojects.com/
62-   Releases: https://pypi.org/project/Jinja2/
63-   Code: https://github.com/pallets/jinja
64-   Issue tracker: https://github.com/pallets/jinja/issues
65-   Test status: https://dev.azure.com/pallets/jinja/_build
66-   Official chat: https://discord.gg/t6rrQZH
67