Loading lesson path
Django
Django Syntax focused on Django Template Variables and related concepts.
Django Template Variables
Template Tags In Django templates, you can perform programming logic like executing if statements and for loops. These keywords, if and for, are called "template tags" in Django. To execute template…
If Statement An if statement evaluates a variable and executes a block of code if the value is true. Example {% if greeting == 1 %} <h1>Hello</h1> {% endif %} Elif The elif keyword says "if the previ…
For Loops A for loop is used for iterating over a sequence, like looping over items in an array, a list, or a dictionary. Example Loop through the items of a list: {% for x in fruits %} <h1></h1> {%…
Comments Comments allows you to have sections of code that should be ignored. Example <h1>Welcome Everyone</h1> {% comment %} <h1>Welcome ladies and gentlemen</h1> {% endcomment %} Comment Descriptio…
Django include Tag