jinja template

jinja template

July 1, 2024 | seedling, permanent

tags :

Summary #

URL 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.

Jinja is a modern and designer-friendly templating language for Python, modelled after Django’s templates. It is fast, widely used and secure with the optional sandboxed template execution environment:

<title>% block title %% endblock %</title>
<ul>
% for user in users %
  <li><a href=" user.url "> user.username </a></li>
% endfor %
</ul>

Features: #

  • sandboxed execution

  • powerful automatic HTML escaping system for XSS prevention

  • template inheritance

  • compiles down to the optimal python code just in time

  • optional ahead-of-time template compilation

  • easy to debug. Line numbers of exceptions directly point to the correct line in the template.

  • configurable syntax


Links to this note

Go to random page

Previous Next