Category "jinja2"

using Django "include" template tag as nested - side effects?

Does anyone know or have any experience about bad side effects of using "nested include tags"? (I mean including a template file which itself includes another t

Flask: How to pass values to base.html?

Some data needs to be present in all templates. How can I transfer the data I need to base.html? For normal templates I use the render() function. I do not unde

jinja2 using {if} within {for}

I'm trying to make a template which iterates over a list to check if a string exists. if it does then something happens, if the string isn't in the list, somet

How to prevent Jinja2 substitution in Ansible playbook?

In my playbook, a JSON file is included using the include_vars module. The content of the JSON file is as given below: { "Component1": { "parameter1" : "

Why do I lose bootstrap styling when passing variables through URL in Flask?

When I pass a variable in Flask my Bootstrap styling doesn't work. If I use a normal app route without the variable the styling works. The relevant code is as f

How to use url_for() to pass path and query data to a route using FastAPI and Jinja2

I want to call a FastAPI route from a jinja2 template and pass both path and query data to the called route. All my attempts fail. I tried something in the jinj

Pyinstaller Import Issues with Jinja2

There are a couple post in regards to Pyinstaller having issuing recognizing jinja2, unfortunately none have resolved my issue. Ideally if Pyinstaller supports

loop.nextitem doesn't work with current value from data

I need to compare postback.campaign_id with the value of the next item. If it's similar, then, I don't print nothing, if not, then, print my row. But, this code

How to compare more than two lists have the same values in same indexes in Ansible?

I would like to compare more than 2 lists, and see if they have the same values in same indexes. I have the previous questions regarding how I can alternate the

Can I pass non-string types via environment variables to meta.yaml?

I am aware that conda's meta.yaml file uses jinja templating, which allows us to pass values to it via environment variables. For example like this: package:

How to sort version numbers in Ansible

I'm building an Ansible playbook in which I want to make a backup of a database in case I need to upgrade the software. For this I want to compare the highest v

'if' statement in jinja2 template

I'm trying to write an if statement in jinja template: {% for key in data %} {% if key is 'priority' %} <p>('Priority: ' + str(data[key])</

Parameter name is changed in bin_params using JinjaSql

Imagine this is my query : query = ''' SELECT * FROM table WHERE id = {{myid}}''' params = {'myid':3} j= JinJaSql(param_style='pyformat

Frozen-Flask, url_for() in Jinja2 and string concatenation during build

When running Flask normally, everything described below works absolutely fine. When running a build in Frozen-Flask however, I run into the following issue: In

Jinja2 template in Python 3 renders bytes with "b" prefix and quotes

I'm upgrading a Flask app from python2 to python3, Jinja2 now renders bytes with trailing b and single quotes, e.g. b'a123' while I need them rendered as a123.

render html strings in flask templates [duplicate]

I'm building a web page to show articles. In my database, I have to attributes, one of which is used to put Markdown code and the other to s

Operator to concatenate two dbt Jinja sets?

In a given model, I am using two macros to create sets for a later loop. Adapting the example from the docs, it looks something like this: {% set pay_1 = ["bank

Rendering a string in django template as json object

I have a angular app that sends json data to a django backend. The django app save the json data in to a DB and later pulls it out to send it back to the angula

How to print spaces from inside a variable in jinja2

I am trying to print a variable number of spaces stored in a variable in jinja2, but jinja is escaping the contents of the variable. So when I store &nbsp i

Jinja2 not found error when using pycaret

I am trying this code in Google Colab !pip install pycaret As part of the install it gives this message Installing collected packages: jinja2 Attempting unin