Jinja2 v3.1.0 Release Notes
-
๐ Released 2022-03-24
- ๐ Drop support for Python 3.6. :pr:
1534
๐ Remove previously deprecated code. :pr:
1544
-
WithExtension
andAutoEscapeExtension
are built-in now. -
contextfilter
andcontextfunction
are replaced bypass_context
.evalcontextfilter
andevalcontextfunction
are replaced bypass_eval_context
.environmentfilter
andenvironmentfunction
are replaced bypass_environment
. -
Markup
andescape
should be imported from MarkupSafe. - Compiled templates from very old Jinja versions may need to be recompiled.
- Legacy resolve mode for
Context
subclasses is no longer supported. Overrideresolve_or_missing
instead ofresolve
. -
unicode_urlencode
is renamed tourl_quote
.
-
๐ Add support for native types in macros. :issue:
1510
The
{% trans %}
tag can usepgettext
andnpgettext
by passing a context string as the first token in the tag, like{% trans "title" %}
. :issue:1430
โก๏ธ Update valid identifier characters from Python 3.6 to 3.7. :pr:
1571
โ Filters and tests decorated with
@async_variant
are pickleable. :pr:1612
Add
items
filter. :issue:1561
โ Subscriptions (
[0]
, etc.) can be used after filters, tests, and calls when the environment is in async mode. :issue:1573
0๏ธโฃ The
groupby
filter is case-insensitive by default, matching other comparison filters. Added thecase_sensitive
parameter to control this. :issue:1463
๐ Windows drive-relative path segments in template names will not result in
FileSystemLoader
andPackageLoader
loading from drive-relative paths. :pr:1621
- ๐ Drop support for Python 3.6. :pr: