DEV Community

Discussion on: [SOLVED]Show data from API on Django tempalte

Collapse
 
sepyrt profile image
Dimitris R • Edited

Hello Vicente,

It appears that the data passed to the template is a list, so you would need a loop to access the title for each item.

{% for item in data %}
<h1>Title: {{ item.title }}</h1>
{% endfor %}
Collapse
 
highcenburg profile image
Vicente G. Reyes

Do you want to answer the question on SO?

Collapse
 
highcenburg profile image
Vicente G. Reyes

HA! Thank you!

You're right, I forgot to loop through the data.

Collapse
 
sepyrt profile image
Dimitris R

No problem, glad to help.

I don't have a SO account though to answer the question there.