Skip to main content

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 %}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Jinja2-3.0.3.tar.gz (269.2 kB view details)

Uploaded Source

Built Distribution

Jinja2-3.0.3-py3-none-any.whl (133.6 kB view details)

Uploaded Python 3

File details

Details for the file Jinja2-3.0.3.tar.gz.

File metadata

  • Download URL: Jinja2-3.0.3.tar.gz
  • Upload date:
  • Size: 269.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for Jinja2-3.0.3.tar.gz
Algorithm Hash digest
SHA256 611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7
MD5 b76ae2f0647abebc81e7c03f5fb7b00f
BLAKE2b-256 91a5429efc6246119e1e3fbf562c00187d04e83e54619249eb732bb423efa6c6

See more details on using hashes here.

Provenance

File details

Details for the file Jinja2-3.0.3-py3-none-any.whl.

File metadata

  • Download URL: Jinja2-3.0.3-py3-none-any.whl
  • Upload date:
  • Size: 133.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for Jinja2-3.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 077ce6014f7b40d03b47d1f1ca4b0fc8328a692bd284016f806ed0eaca390ad8
MD5 31d7a56a843bbf4ef35e0076fea86767
BLAKE2b-256 209ae5d9ec41927401e41aea8af6d16e78b5e612bca4699d417f646a9610a076

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page