Most voted "jinja2" questions
Jinja2 is a modern and friendly modeling language, developed for Python, modeled after Django templates.
Learn more…16 questions
Sort by count of
-
4
votes2
answers84
viewsConflict between Jinja and Handlebars
How do I resolve a conflict between Handlebars and Jinja, since the syntax of both are similar?
-
3
votes1
answer109
viewsHow to repeat a block of Jinja2?
I’m using the Jinja2 as a template engine to generate a static HTML site in a Python script. I want to repeat the contents of a block (title) in the layout template (html layout.), that is like:…
-
1
votes1
answer179
viewsMany-to-Many: Model and Django Template
I have the following situation: - Budget - Product - Items in the Budget I sought the relationship Many-to-Many in Django (1.10), until then quiet, creates in the Template a Multi-select. But if by…
-
1
votes1
answer58
viewsGoogle App Engine Python project works on localhost but gives server error
My project is running perfectly on the localhost but when I deploy and access it gives the following error: Here is my code: import os import jinja2 import webapp2 import json from…
-
1
votes1
answer436
viewsFLASK - Changeable in template
I passed to the template a variable and need to change (in the template) the value of it. Ex.: in the controller: return render_template('index.html', start_code = start_code). I need to change…
-
1
votes1
answer744
viewsHow does the "extends" and "block endblock" commands of Jinja2 work?
I’m using Jinja2 to create templates for my application. However, I was confused about two of its features. The features are: The command extends: {% extends 'pagina-exemplo.html' %} and the command…
-
1
votes1
answer61
viewsHow to iterate a list in Flask
I have this code in Flask (which uses the Jinja2) {%block content%} {% for i in posts %} {% set x = x + 1 -%} <p style="border: 1px solid black; padding: 5px 5px; border-radius: 5px;">{{ i[x]…
-
0
votes2
answers77
viewsELIF using not in, inside a FOR
I would like to know if there is any way to refine the ELIF within a FOR, so that it does not enter into it whenever the date does not exist, but if that date specifies it does not exist. Follow the…
-
0
votes1
answer48
viewsjinja2 error: jinja2.exceptions.Templatesyntaxerror: Unexpected '%'
My code is generating a " Unexpected '%' error", all symbols being properly correct. I have a route to show the companies Cnpjs in a list, follows function of the listing below:…
-
0
votes1
answer66
viewsloop for Jinj2 flask
I have a loop 'for" in the template only I want it to show a certain amount result. {% for form in form %} <tr> <td><img src="../static/img/arrow-gray.png" alt=""> <font…
-
0
votes0
answers38
viewsDjango form that varies according to another form
How do I create a form in Jango of an object and that the price of the object varies according to the size of the object without having to update the page. #py.models class Pizza(models.Model):…
-
0
votes0
answers25
viewsFind the chosen option in HTML with Django form
Hello, I created a form with some options to be chosen, follows Forms.py file class BuscaForm(forms.Form): FIELDCHOICE = [ ('1', 'CNPJ'), ('2', 'Razão Social'), ('3', 'Nome Fantasia'), ('4',…
-
0
votes1
answer145
viewsUsing IF ELSE JINJA2 Python and Flask
I’m starting web development using Python and Flask, I am trying to change the class of a TAG but analyzing the value I am going through to be reinderized follows below how I am doing to try to use…
-
0
votes1
answer88
viewsHow to get the current user in the HTML page to insert in the Flask Python database
Hello I need to get the user who is logged in to the system for when he does an Update or Insert in the database enter his record, currently in the template I can already get the user name with this…
-
-1
votes1
answer71
viewsHow can I just let my page access the file
I have a Flask page, and wanted to know how to make only my page access the files from Static I have a handling of files from Static (for image resizing):…
-
-1
votes1
answer29
viewsHow do I create a dynamic link to a Django admin screen?
How to use the tags of the Django templates to create a dynamic link to the admin boards? Let’s say the name of the admin panel is ProductsAdmin, and that this table was created and registered in…