About 4,270,000 results
Open links in new tab
  1. What does this "-" in jinja2 template engine do? - Stack Overflow

    Aug 5, 2012 · What does this "-" in jinja2 template engine do? Asked 13 years, 3 months ago Modified 3 years ago Viewed 33k times

  2. How to use conditional if statements in Jinja 2? - Stack Overflow

    So I am new to Django and can use some help. I have used a for loop to display a list from my database. But I want to add an if statement such that, if the user input matches my database …

  3. jinja2 - What dashes mean in jinja templates? - Stack Overflow

    Turns out that + and - are there for whitespace control purpose. You can manually disable the lstrip_blocks behavior by putting a plus sign (+) at the start of a block [...] You can also strip …

  4. jinja2 - How do you test if a variable is undefined? - Stack Overflow

    From the Jinja2 template designer documentation: {% if variable is defined %} value of variable: {{ variable }} {% else %} variable is not defined {% endif %}

  5. jinja2 - How to write a multiline Jinja statement - Stack Overflow

    Mar 1, 2013 · Learn how to write multiline Jinja statements effectively with examples and tips on Stack Overflow.

  6. How to pass selected, named arguments to Jinja2's include context?

    Using Django templating engine I can include another partial template while setting a custom context using named arguments, like this: {% include "list.html" with articles=articles_list1 only …

  7. jinja2 - how to iterate over a list of list in jinja - Stack Overflow

    May 5, 2015 · I have a list of list like : [[elem0, elem1, elem2], [elem3, elem4, elem5], [elem6, elem7, elem8], ...] I wrote the follow template file : {% for result in results ...

  8. jinja2 - String concatenation in Jinja - Stack Overflow

    Jan 14, 2010 · I just want to loop through an existing list and make a comma delimited string out of it. Something like this: my_string = 'stuff, stuff, stuff, stuff' I already know about loop.last, I …

  9. How to increment a variable on a for loop in jinja template?

    Sep 24, 2011 · Jinja2 variables behaves differently from that of conventional scripting languages, you can't modify the variable in a for loop.Hence to bypass this behaviour you can use a …

  10. jinja2 - How to output loop.counter in python jinja template?

    I want to be able to output the current loop iteration to my template. According to the docs, there is a loop.counter variable that I am trying to use: <ul> {% for user in userlist %} <l...