If set is used at the top-level, it changes the value of the global template context. If used inside scoped blocks like an include or a macro, it only modifies the current scope. It is also possible to capture the contents of a block into a variable using block assignments. Sep 17, 2017 · I'm trying to change the value of a variable inside a loop, this way I can do some stuff for the first iteration only, then do other stuff for all the next iterations

The following are code examples for showing how to use jinja2.StrictUndefined().They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.