jinja2 template medium code example
Example 1: jinja2 base template
{% extends "layout.html" %}
{% block title %}Index{% endblock %}
{% block head %}
{{ super() }}
<style type="text/css">
.important { color: #336699; }
</style>
{% endblock %}
{% block content %}
<h1>Index</h1>
<p class="important">
Welcome on my awesome homepage.
{% endblock %}
Example 2: jinja2 template import html with as
{% from 'forms.html' import input with context %}
{% include 'header.html' without context %}