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
Chris Howell
Python Web Development Techdegree Graduate 49,483 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 %}