Answer the question
In order to leave comments, you need to log in
How to render a django list item in a template?
Suppose I have an object a = [45, 66, 77]. I pass it from views to the html page. How can I display the first element, and only?
Tried
<p> {{ a[0] }} </p>
<p> {{ a | [0] }} </p>
<p> {{ a | a[0] }} </p>
<p> {{ a.get(0) }} </p>
<p> {{ a | get(0) }} </p>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question