November 2015
Beginner to intermediate
840 pages
26h 30m
English
To iterate and print the lists of startups and blog posts associated with a Tag object, we need something a little more powerful than simple variables. We need a loop.
Just as Django allows for variables through the {{ }} delimiters, Django provides template tags, which are delimited by {% %}. Template tags allow for conditional logic, loops, and evaluation of functions and methods, meaning that we can run and evaluate Python in our template.
Info
On top of the {{ variable }} and {% expression %} delimiters, Django supplies {# #}, which is used to write comments in templates. The utility of using template comments over markup-specific comments is that they will not appear in the output of the rendered templates. ...
Read now
Unlock full access