欢迎来到Jinja2 2.9¶
本文档最初的翻译迁移自Jinja2 2.7的翻译,感谢初始译者。
Jinja2 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>
特性:
- 沙箱中执行
- 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
Jinja2文档¶
Additional Information¶
If you can’t find the information you’re looking for, have a look at the index or try to find it using the search function: