Django SyntaxLesson 32Free preview
Django For Loop
This lesson is part of Django · All levels
Summary
Tag for performs a repetition on a list of data, for example displaying the entire member. You can also use forloop.counter for the sequence number and check the empty state with {% empty %}. This is the standard way to display the collection.
Key points
- {% for %} repeat the data list
- Closed with {% endfor %}
- Give the order number
- {% empty %} handles the empty list
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.