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

Christopher Shaw
seal-mask
PLUS
.a{fill-rule:evenodd;}techdegree seal-36
Christopher Shaw
Python Web Development Techdegree Graduate 58,248 Points

Simple extends keeps failing

The question is only in list.html to extend layout.html. I don't know why it keeps failing. I have tried both and neither are working:

{% extends "layout.html" %}

or

{% extends "code_challenges/layout.html" %}
code_challenges/templates/code_challenges/layout.html
<html>
    <head>
        <title>{% block title %}{% endblock %}</title>
    </head>
    <body>
        <div class="page-header">
            <!-- YOUR CODE HERE -->

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

3 Answers

Simon Coates
Simon Coates
28,694 Points

dunno. I took at look at an earlier post, which i think is the same question. They seemed to have success with a set of code that looks like yours.

Christopher Shaw
seal-mask
PLUS
.a{fill-rule:evenodd;}techdegree seal-36
Christopher Shaw
Python Web Development Techdegree Graduate 58,248 Points

Thank you Simon, When I copied and pasted Chris Freeman answer, Task two then passed, but as soon as I checked Task 3 (code below), it says that Task 2 is no longer passing.

{% extends "code_challenges/layout.html" %}
{% block title %}Welcome to the code challenges!{% endblock %}
Christopher Shaw
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Christopher Shaw
Python Web Development Techdegree Graduate 58,248 Points

And I forgot to mention, also to get task 2 to pass, I have to include the original title as default text.

<title>{% block title %}Code Challenge{% endblock %}</title>
Simon Coates
Simon Coates
28,694 Points
<html>
    <head>
        <title>Code Challenge</title>
    </head>
    <body>
        <div class="page-header">
            {% block header %}{% endblock %} 
        </div> 
    </body>
</html>
{% extends "code_challenges/layout.html" %}
{% block header %}Welcome to the code challenges!{% endblock %}

I wasn't sure where you got up to, but the following works. Some of the error messages i got seemed to be wrong. It keps telling me it couldn't find layout.

Simon Coates
Simon Coates
28,694 Points

I think treehouse's messages and testing for this challenge may be messed up. The message about layout being missing disappeared after i changed my code for task1. It doesn't make any sense to me.