Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

double curly brace {{

Tags:

python

django

So I was following the Django tutorial and came across this:

{{ question }}

I am very confused as to what that inner set of curly braces are for. I assumed the outer set was meant to differentiate python from the html django says to put.

Could someone please explain to me what the inner set of curly braces are for?

like image 807
isignisign Avatar asked Apr 07 '16 06:04

isignisign


People also ask

What is double curly braces in JSON?

JSON syntax is basically considered as a subset of JavaScript syntax; it includes the following − Data is represented in name/value pairs. Curly braces hold objects and each name is followed by ':'(colon), the name/value pairs are separated by , (comma). Square brackets hold arrays and values are separated by ,(comma).

What is double curly braces in HTML?

The double curly brackets are not HTML but scripting code. The term inside, interest, is a placeholder, sort of like the name and address in a form letter. The string {{interest}} will be replaced when the HTML template is converted into straight HTML that is sent over the network to the user.

What do double curly brackets mean in Yaml?

It says that double curly braces {{ variable }} are used to evaluate expressions. Whilst distinguishing a single curly braces (after a colon), that is used to declare a dictionary.

What are double curly braces called?

Interpolation in Angular In simple terms, when you send data from an Angular component to the template using the mustache syntax or what you would call double curly brackets (these: “{{ … }}”) it is called interpolation. You can use it with variables, objects and even functions.


1 Answers

The curly braces are part of Django Template Language

The part encapsulated between double curly braces {{ }} is nothing but a variable.

That's how DTL, Jinja2 and other template languages work. They have their own set of rules which translates the template in to python and later to HTML code.

like image 70
v1k45 Avatar answered Sep 30 '22 17:09

v1k45