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 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

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 %}