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

Download files

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

Source Distribution

Jinja2-2.10.3.tar.gz (257.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Jinja2-2.10.3-py2.py3-none-any.whl (125.3 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: Jinja2-2.10.3.tar.gz
  • Upload date:
  • Size: 257.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.4

File hashes

Hashes for Jinja2-2.10.3.tar.gz
Algorithm Hash digest
SHA256 9fe95f19286cfefaa917656583d020be14e7859c6b0252588391e47db34527de
MD5 7883559bc5cc3e2781d94b4be61cfdcd
BLAKE2b-256 7bdb1d037ccd626d05a7a47a1b81ea73775614af83c2b3e53d86a0bb41d8d799

See more details on using hashes here.

File details

Details for the file Jinja2-2.10.3-py2.py3-none-any.whl.

File metadata

  • Download URL: Jinja2-2.10.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 125.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.4

File hashes

Hashes for Jinja2-2.10.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 74320bb91f31270f9551d46522e33af46a80c3d619f4a4bf42b3164d30b5911f
MD5 8ea90ab711841aad4d846613305ca59e
BLAKE2b-256 65e0eb35e762802015cab1ccee04e8a277b03f1d8e53da3ec3106882ec42558b

See more details on using hashes here.

Supported by

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