Armin Ronacher

Jinja 2.2 Released

written by Armin Ronacher, on Sunday, September 13, 2009 7:46.

I'm happy to announce the 2.2 Release (Codename Kong) of Jinja 2, the high performance, sandboxed template engine for Python. What's new in this release?

  • {% include %} tags now have an “ignore missing” marker that tells Jinja to skip missing files silently.
  • Priority of not raised. You can now write foo not in bar and do what it does in Python.
  • Fixed many problems with {% call %} and {% macro %} tags in loops.
  • Included templates can now access all variables from outer scopes properly.
  • Added “scoped” modifier for blocks that cause them to be affected by scoping rules.
  • Added support for line-based comments.
  • Added the meta module that gives access to some Jinja internals in a supported way.

Grab it while it's hot from the Python Package Index

Comments

  1. Thanks for the share Armin. The meta module was a good move

    —  Athira on Sunday, September 13, 2009 12:03 #

  2. It's great that development continues.

    —  Dave on Monday, September 14, 2009 14:32 #

  3. Looking forward to messing around with Jinja 2.2 when I get a little more free time!

    —  Robert on Thursday, September 17, 2009 1:38 #

  4. there seems to be an issue in assignment

    This doesn't work as i would expect:

    {% set count=1 %}
    {% for group in user_groups %}
    {% for u in group %}
    {% set count=count+1 %} <!--always starts with 1! > {% endfor %} <p>now have {{count}} users</p><!--always =1! no matter how many times count was updated in the inner loop -->{% endfor %}

    —  Evgeny on Monday, October 5, 2009 21:27 #

  5. That is not a bug, that is documented behavior. A loop opens a new scope and you cannot assign into higher scopes. Why would you want to do that?

    —  Armin Ronacher on Tuesday, October 6, 2009 23:33 #

Leave a Reply