Jin Ku KL
Jin Ku KL
Jin Ku KL
The Jinja template engine allows customization of tags,[2] filters, tests, and
Original author(s) Armin
globals.[3] Also, unlike the Django template engine, Jinja allows the template
Ronacher
designer to call functions with arguments on objects. Jinja is Flask's default
template engine [4] and it is also used by Ansible [5] and Trac. Stable release 2.10.1 / April 6,
2019[1]
Repository github.com
Contents /pallets/jinja (htt
ps://github.co
Features m/pallets/jinja)
Example
Sources
Written in Python
External links
Type Template
engine
Example
Here is a small example of a template file "example.html.jinja":[7]
<!DOCTYPE html>
<html>
<head>
<title>{{ variable|escape }}</title>
</head>
<body>
{%- for item in item_list %}
{{ item }}{% if not loop.last %},{% endif %}
{%- endfor %}
https://en.wikipedia.org/wiki/Jinja_(template_engine) 1/3
10/15/2019 Jinja (template engine) - Wikipedia
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Value with <unsafe> data</title>
</head>
<body>
1,
2,
3,
4,
5,
6
</body>
</html>
Sources
1. "GitHub - pallets/jinja: The Jinja2 template engine" (https://github.com/pallets/jinja). March 5, 2019 – via GitHub.
2. "Extensions" (http://jinja.pocoo.org/docs/dev/extensions/#module-jinja2.ext). Jinja2 Documentation (2.8-dev).
Retrieved 2015-05-26.
3. "Extensions" (http://jinja.pocoo.org/docs/dev/extensions/#expression-statement). Jinja2 Documentation (2.8-dev).
Retrieved 2015-05-26.
4. DuPlain, R. (2013). Instant Flask Web Development (https://books.google.com/books?id=nbJVx2uDfgoC&pg=PT30).
Packt Publishing. p. 30. ISBN 978-1-78216-963-5. Retrieved 2015-05-26.
5. https://docs.ansible.com/ansible/latest/user_guide/playbooks_templating.html
6. "Welcome | Jinja2 (The Python Template Engine)" (http://jinja.pocoo.org/). jinja.pocoo.org.
7. Ronacher, Armin. "Template Designer Documentation" (http://jinja.pocoo.org/docs/dev/templates/). Jinja2
Documentation. Retrieved 7 January 2016. "A Jinja template doesn’t need to have a specific extension: .html, .xml, or
any other extension is just fine."
External links
Jinja website (http://jinja.pocoo.org/)
Jinja2 (https://pypi.python.org/pypi/Jinja2) on Python pypi
jinja2 (https://github.com/mitsuhiko/jinja2) on GitHub
https://en.wikipedia.org/wiki/Jinja_(template_engine) 2/3
10/15/2019 Jinja (template engine) - Wikipedia
Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this
site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia
Foundation, Inc., a non-profit organization.
https://en.wikipedia.org/wiki/Jinja_(template_engine) 3/3