All technological notes.
Template inheritance
base template
child templates:
block tag:
extends tag:
When a tag is not defined by the children templates, the content in base template will apply.
When the content of the block from the parent template is needed in child template, the tag `` can be used.
base.html<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="style.css" />
<title>__ block title __ My amazing site__ endblock __</title>
</head>
<body>
<div id="sidebar">
__ block sidebar __
<ul>
<li><a href="/">Home</a></li>
<li><a href="/blog/">Blog</a></li>
</ul>
__ endblock __
</div>
<div id="content">__ block content __ __ endblock __</div>
</body>
</html>
child.html__ extends "base.html" __ __ block title __My amazing blog__ endblock __ __
block content __ __ for entry in blog_entries __
<h2></h2>
<p></p>
__ endfor __ __ endblock __