About 3,920,000 results
Open links in new tab
  1. Escape jinja2 syntax in a jinja2 template - Stack Overflow

    Aug 18, 2014 · I serve dynamic pages from Jinja2 templates in Flask. Now I am defining client-side templates in say, Jinja2-clone Nunjucks inside a script tag. Problem is, the client-side …

  2. Get lengths of a list in a jinja2 template - Stack Overflow

    jinja2's builtin filters are documented here; and specifically, as you've already found, length (and its synonym count) is documented to: Return the number of items of a sequence or mapping. …

  3. jinja2 - How to use logic operators in jinja template on salt-stack ...

    Jan 26, 2017 · I am using a jinja template to generate a state file for salt. I added some conditionals and would like to express: if A or B. However, it seems I cannot get any logical …

  4. 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 …

  5. 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 ...

  6. jinja2 - How to remove trailing whitespaces from string in Jinja ...

    Nov 7, 2018 · In my case all the strings are single-worded and the trailing whitespaces from the strings need to be removed, e.g., 'hello '→ 'hello'; 'hello '→ 'hello'. One approach could be

  7. How to load jinja template directly from filesystem

    The jinja API document at pocoo.org states: The simplest way to configure Jinja2 to load templates for your application looks roughly like this: from jinja2 import Environment, …

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

    How to pass selected, named arguments to Jinja2's include context? Asked 13 years, 8 months ago Modified 1 year, 7 months ago Viewed 103k times

  9. 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.

  10. How can I escape double curly braces in jinja2? - Stack Overflow

    Apr 1, 2019 · I need to escape double curly braces in a code I'm working on using Ansible. The thing is I have all those parameters that needs to be transformed in variables. Basically I'm …