Python Flask Basics Templates and Static Files Template Inheritance

Sam Akers
Sam Akers
4,744 Points

Can't extend "layout.html"

For some reason I can only see "Hello from Sam" printed on the page.

"Brought to you by the fine folks at Treehouse!" does not render at all.

Within the templates folder I have add.html ,index.html and layout.html

Outwith this folder is


{% extends "layout.html" %}

{% block title %}Howdy!{% endblock %}

{% block content %}
<h1>Hello from {{ name }}!</h1>
{% endblock %}


<!DOCTYPE html>
    <title>{% block title %}{% endblock %}</title>
    {% block content %}{% endblock %}
    <p>Brought to you by the fine folks at Treehouse!</p>
Josh Stephens
Josh Stephens
12,592 Points

Copied your you files exactly as you have typed and I seem to get a different result. With that in mind I think your code is probably correct, which leads me to think that you should try one of the two things first

  1. Copy the code from here and save each file and then reload if you are still running or
  2. Restart your dev server (which is just CTRL + C) and then run python again