Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Django Basics Django Templates Override a block

Akhilesh Gandhe
Akhilesh Gandhe
1,177 Points

I couldn't understand the question of for loop

Can anyone explain this particular question asked

articles/templates/articles/article_list.html
{% extends "base.html" %}
{% for article in articles %}
{{ article.headline }}
{% endfor %}

1 Answer

Linking back to a previous post on this: https://teamtreehouse.com/community/now-put-the-existing-contents-of-articlelisthtml-the-for-loop-into-the-block-content-2

From Chris Freeman: "What the challenge is asking you to wrap the existing for loop with a block tag that is named "content". This means adding the start block tag before the {% for .... %} and adding an endblock tag after the {% endfor %}.

The start block tag would be {% block content %} and the end block tag would be {% endblock %}"

I followed this and was able to pass the challenge.