Python Flask Basics Templates and Static Files Template Inheritance

Ron Tovbin
Ron Tovbin
Python Web Development Techdegree Student 6,268 Points

Having some trouble with this Flask task.

Here is my solution .. but apparently need more here. Any assistance would be much appreciated.

{% extends "layout.html" %} <head><title>{% block title %}Homepage{% endblock %}</title></head> {% block content %}{{ super() }}{% endblock %}

flask_app.py
from flask import Flask
from flask import render_template

app = Flask(__name__)


@app.route('/')
def index():
    return render_template('index.html')
templates/index.html
{% extends "layout.html" %}
<head><title>{% block title %}Homepage{% endblock %}</title></head>
{% block content %}{{ super() }}{% endblock %}
templates/layout.html
<!doctype html>
<html>
<head><title>{% block title %} Smells Like Bakin' {% endblock %}</title></head>
{% block content %}
<body>
<h1>Smells Like Bakin'!</h1>
<p>Welcome to my bakery web site!</p>
</body>
{% endblock %}
</html>