Django SyntaxLesson 29Free preview
Django Variables
This lesson is part of Django · All levels
Summary
The template variable displays data sent from the view, for example {{name}} for the object attribute. You can break through a tiered property like member.firstname}} and use a filter to format the value. This is the main way to display dynamic data on a page.
Key points
- The variable is written with two parentheses
- It can penetrate the attributes of a layered object.
- The filter is written with a pipe mark
- Value is taken from the context that sent view
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.