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.2.tar.gz (268.7 kB view details)

Uploaded Source

Built Distribution

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

Jinja2-3.0.2-py3-none-any.whl (133.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: Jinja2-3.0.2.tar.gz
  • Upload date:
  • Size: 268.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 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.2.tar.gz
Algorithm Hash digest
SHA256 827a0e32839ab1600d4eb1c4c33ec5a8edfbc5cb42dafa13b81f182f97784b45
MD5 059f89375d7ea60eb7013f341f0b89e7
BLAKE2b-256 f8867c0eb6e8b05385d1ce682abc0f994abd1668e148fb52603fa86e15d4c110

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Jinja2-3.0.2-py3-none-any.whl
  • Upload date:
  • Size: 133.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8569982d3f0889eed11dd620c706d39b60c36d6d25843961f33f77fb6bc6b20c
MD5 bba78f8ad506a0dab71792478b69d572
BLAKE2b-256 9442d8bca8e99789bcc35dfa9b03acaa8b518720d6e060163745bc2bf2ead842

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