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 Customizing Django Templates Template Tags and Filters Blocks and Inheritance

SUVODEEP DUBEY
SUVODEEP DUBEY
2,470 Points

Adding Header To Layout.html

This is in code challenge.Could someone review my code

code_challenges/templates/code_challenges/layout.html
<html>
    <head>
        <title>{% block head %}Welcome to the code challenges!{% endblock %}</title>
    </head>
    <body>
        <div class="page-header">
            <!-- YOUR CODE HERE -->
            {% block abc %}{% endblock %}

        </div> 
    </body>
</html>
code_challenges/templates/code_challenges/list.html
{% extends "code_challenges/layout.html" %}

{% block title %}Welcome to the code challenges!{% endblock %}

{% block content %}Here Is The Title{% endblock %}

1 Answer

Alex Koumparos
seal-mask
.a{fill-rule:evenodd;}techdegree
Alex Koumparos
Python Development Techdegree Student 36,887 Points

Hi Suvodeep,

In list.html you are using the blocks you declared in layout.html (that's what extends is referring to). Accordingly, the block names in list.html must match the block names in layout.html. Observe that you have a block called 'title' in list.html but no such block in layout.html. Similarly, you have a block named 'content' in list.html but no such block in layout.html.

Hope that helps

Cheers

Alex