title: is dividing a template into parts and including each part bad?
body: <p>I have a base template that I'd like to split up into three parts: header, body, footer. Then I use the base template to include the three sub-templates. However, from what I've seen, this means I cannot override {{ block }} content. Is using includes a bad idea then? Or is there a way to override block content in an included template?</p>
  
  <p>I know that you can send static context variables to the included segment, but it needs to be more dynamic.</p>
  
  <p>My code:</p>
  
  <p>In header.html</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;script url="..."&gt;&lt;/script&gt;
          &lt;link rel="..." /&gt;
          {% block head_extension %}
  
          {% endblock %}
      &lt;/head&gt;
      &lt;body&gt;
          &lt;header&gt;
              &lt;div class="headerstuff"&gt;
              &lt;/div&gt;
          &lt;/header&gt;
  </code></pre>
  
  <p>Then in the body.html file:</p>
  
  <pre><code>        &lt;div class="container"&gt;
              {% block content %}
                  Foo fum my content    
              {% endblock %}
          &lt;/div&gt;
  </code></pre>
  
  <p>footer.html:</p>
  
  <pre><code>        &lt;footer&gt;
              {% block footer %}
                  Copyright 2015
              {% endblock %}
          &lt;/footer&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>base.html:</p>
  
  <pre><code>{% include "header.html" %}
  {% include "body.html" %}
  {% include "footer.html" %}
  &lt;!-- and the part that doesn't work --&gt;
  {% block head_extension %}
      &lt;script src="unique_script"&gt;&lt;/script&gt;
  {% endblock %}
  {% block content %}
      My unique content
  {% endblock %}
  {% block footer %}
      Copyright 2011
  {% endblock %}
  &lt;!-- end broken django templating try --&gt;
  </code></pre>
  
  <p>Am I doing something wrong? The templating documentation seemed to indicate that what I am trying to do doesn't work. It seems like this would be the best way to create easy-to-read templates. Is it better just to have all parts in one large file? As you can imagine, the header, body, and footer elements are much larger than this demonstration. But the point remains.</p>
  
  <p>I am hoping there is a way to do what I'm thinking of that I'm not aware of.</p>
  
  <p>Thanks in advance</p>