0PricingLogin
Flask Academy · Lesson

Extend the Base in Child Pages

Use extends and fill blocks per page.

Connect a Page to the Base

A child page does not repeat the skeleton. It declares that it extends the base, then fills only the blocks it needs to change. 🔗

The extends Tag

The first line of a child template uses extends to name its parent layout. This tells Jinja2 to inherit the base before rendering.

{% extends "base.html" %}

All lessons in this course

  1. Define a Base Template with Blocks
  2. Extend the Base in Child Pages
  3. Include Reusable Partials
  4. Macros for Repeated Markup
← Back to Flask Academy