Category "jinja2"

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

Ansible change all dict key values only by filters

I have an ansible dict like ports: webui: 7200 webadmin: 7209 core_api: 7201 stock_api: 7204 import_export: 7207 And i want to transform all keys i

Issue in placing DataDog log annotation on deployment via ansible

I am using ansible version 2.7 for kubernetes deployment. For sending logs to datadog on kubernetes one of the way is to configure annotations like below, tem

Python Vlookup to return one value only - similar to excel

I'm trying to replicate an Excel Vlookup in Python, using Flask. I've an excel sheet, set out like this: (Item is column A, Price is column B). Item:

Nested print statements in Jinja template

I am creating a link in a Jinja2 template using Flask and I am running into a problem. I want to access a variable passed to the template within a code block, b

HTML tbody only is only one header column width

I have a problem in HTML. I want to make a table with a fixed header and a scrollable body. The body (tbody) is composed of the rows of the table, and the head

FastAPI - How to render Jinja2 template with variable that contains special characters?

I'm trying to render this Jinja2 template: @app.get("/", response_class=HTMLResponse) async def read_root(request: Request, item: Optional[str] = None): ite

ImportError: cannot import name 'Markup' from 'jinja2'

When I recently deployed my project that includes Flask==1.0.2 and Jinja2>=2.10.1, I got the following error. It was running fine when I deployed it the prev

Pass variables to Flask's render_template

I want to pass multiple variables from my Flask view to my Jinja template. Right now, I can only pass one. How do I pass multiple variable when rendering a temp

Using <input> inside for loop in jinja flask

I am struggling to figure out how to access individual <input> elements, that have been created through a for loop. For example: <form id="score" metho

Changing the active class of a link with the twitter bootstrap css in python/flask

I got the following html snippet from my page template.html. <ul class='nav'> <li class="active"><a href='/'>Home</a></li>