Created
February 16, 2015 04:39
-
-
Save rtuita23/5f0b21acea6d8a4101ad to your computer and use it in GitHub Desktop.
Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Flask Template Example</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<style> | |
div#main { | |
max-width: 500px; | |
padding: 20px; | |
} | |
nav .title { | |
font-weight: bold; | |
} | |
a.active { | |
font-weight: bold; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="main"> | |
{% extends "base.html" %} | |
{% block content %} | |
<h3> This is the start of my child template</h3> | |
<br> | |
<p>My string: {{my_string}}</p> | |
<p>Value from the list: {{my_list[1]}}</p> | |
<p>Loop through the list:</p> | |
<ul> | |
{% for n in my_list %} | |
<li>{{n}}</li> | |
{% endfor %} | |
</ul> | |
<h3> This is the end of my child template</h3> | |
{% endblock %} | |
</div> | |
</body> | |
{% block footer %} | |
{{super()}} | |
...and this addition to the footer is coming from the child template. | |
{% endblock %} | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment