Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment.
Here a small example of a Jinja template:
{% extends 'base.html' %}
{% block title %}Memberlist{% endblock %}
{% block content %}
<ul>
{% for user in users %}
<li><a href="{{ user.url }}">{{ user.username }}</a></li>
{% endfor %}
</ul>
{% endblock %}
Application logic is for the controller, but don't make the template designer's life difficult by restricting functionality too much.
For more information visit the new Jinja2 webpage and documentation.
The Jinja2 tip is installable via pip
with pip install
https://github.com/pallets/jinja/zipball/master
.
master |
|
2.9-maintenance |
- Website: http://jinja.pocoo.org/
- Documentation: http://jinja.pocoo.org/docs/
- License: BSD
- Releases: https://pypi.org/project/Jinja2/
- Code: https://github.com/pallets/jinja
- Issue tracker: https://github.com/pallets/jinja/issues
- Official chat: https://discord.gg/t6rrQZH