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.0rc2.tar.gz (260.4 kB view details)

Uploaded Source

Built Distribution

Jinja2-3.0.0rc2-py3-none-any.whl (125.4 kB view details)

Uploaded Python 3

File details

Details for the file Jinja2-3.0.0rc2.tar.gz.

File metadata

  • Download URL: Jinja2-3.0.0rc2.tar.gz
  • Upload date:
  • Size: 260.4 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

Hashes for Jinja2-3.0.0rc2.tar.gz
Algorithm Hash digest
SHA256 fd581ab32650fec6d24e8f035dd9757f3549ea6e559534d5d2385d4ade7e0fe1
MD5 6b745bf6deb541855b4d76b08b6e3dd6
BLAKE2b-256 9db9a44eeca96b327d1d1776527d4825ad2e624f24574717fb9b2fe26c411862

See more details on using hashes here.

File details

Details for the file Jinja2-3.0.0rc2-py3-none-any.whl.

File metadata

  • Download URL: Jinja2-3.0.0rc2-py3-none-any.whl
  • Upload date:
  • Size: 125.4 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

Hashes for Jinja2-3.0.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 8e68a2e702a59a57c86305752df25532472a0dad2b4b2756a1d289c618a9e1f5
MD5 d3fa9977739c5c056a6f7247701a71bb
BLAKE2b-256 0aedf0ddd65b6c118322d38db13dc7a806ef121c43df89b60a8ec27ff1e2fbe4

See more details on using hashes here.

Supported by

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