Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Flask Basics Templates and Static Files Template Inheritance

Flask Basics - Challenge Task 5 of 6 - index.html is not passing

{% extends "layout.html" %}

{% block title %}Homepage{% endblock %}

{% block content %}
<body>
<h1>Smells Like Bakin'!</h1>
<p>Welcome to my bakery web site!</p>
</body>
{% endblock%}

2 Answers

Chris Howell
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Chris Howell
Python Web Development Techdegree Graduate 49,608 Points

it looks like the part that was failing is:

Edit

Remove everything from "index.html" except for the extends and block tags and their contents.

It wants you to remove the already existing elements in layout.html, using only blocks inside the index.html. So you dont need to repeat elements you have wrapped around your blocks from layouts. if that makes sense.

So if you have a body tag inside layouts.html that is wrapping around the block content tag. Then inside your index.html tag if you wrap another body tag around the same block content tag you will end up with a page that has two opening and closing body tags inside each other.

Sharif Ahmed
Sharif Ahmed
11,629 Points

{% extends "layout.html" %}

{% block title %} Homepage {% endblock %}

{% block content %} <h1>Smells Like Bakin'!</h1> <p>Welcome to my bakery web site!</p> {% endblock %}