A very fast and expressive template engine.
Project description
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:
$ pip install -U Jinja2
In A Nutshell
{% 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 %}
Donate
The Pallets organization develops and supports Jinja and other popular packages. In order to grow the community of contributors and users, and allow the maintainers to devote more time to the projects, please donate today.
Links
Documentation: https://jinja.palletsprojects.com/
PyPI Releases: https://pypi.org/project/Jinja2/
Source Code: https://github.com/pallets/jinja/
Issue Tracker: https://github.com/pallets/jinja/issues/
Website: https://palletsprojects.com/p/jinja/
Twitter: https://twitter.com/PalletsTeam
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file Jinja2-3.0.1.tar.gz
.
File metadata
- Download URL: Jinja2-3.0.1.tar.gz
- Upload date:
- Size: 267.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 703f484b47a6af502e743c9122595cc812b0271f661722403114f71a79d0f5a4 |
|
MD5 | 25ba6ef98c164878acff1036fbd72a1d |
|
BLAKE2b-256 | 39118076571afd97303dfeb6e466f27187ca4970918d4b36d5326725514d3ed3 |
File details
Details for the file Jinja2-3.0.1-py3-none-any.whl
.
File metadata
- Download URL: Jinja2-3.0.1-py3-none-any.whl
- Upload date:
- Size: 133.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f06f2da51e7b56b8f238affdd6b4e2c61e39598a378cc49345bc1bd42a978a4 |
|
MD5 | b377af8123a32e992984222bff51e152 |
|
BLAKE2b-256 | 8021ae597efc7ed8caaa43fb35062288baaf99a7d43ff0cf66452ddf47604ee6 |