Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Flask templates don't have to be just simple HTML documents. Thanks to Jinja2 and the power of template inheritance, you can make smarter, lighter template files that still pack a big punch.
New Terms
{% block %}
: This template tag (as they're called) defines a block in a template. In templates that are extended, these areas are overridable. In templates that extend other templates, this areas will override the parent template's block.
{% extends %}
: This template tag specifies what template is the parent of the current template. Think of it like extended classes in Python. You can have a change of extensions if you need them.
{{ super() }}
: This function brings in whatever content was in the same block in the parent template. Very handy if you want to include the existing content but you want to insert new content before or after the old.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Megan Weber
32,266 PointsWouldn't ending the title block before "Flask Basics" do the same thing as using super?
Posted by Megan WeberMegan Weber
32,266 Points1 Answer
-
Sam Akers
4,744 Points1 Answer
-
Nam Doan
3,026 Points0 Answers
-
KARTIK BHASIN
9,299 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up