I can't expand the template django
<p>I can't expand the template <code>base.html</code> template <code>header.html</code></p>

<p>Content  <code>base.html</code></p>

<pre><code>&lt;div id="main-container"&gt;
  &lt;!-- HEADER --&gt;
  {% block header %}{% endblock %}
  &lt;!-- END HEADER --&gt;
&lt;/div&gt;
</code></pre>

<p>Content  <code>header.html</code></p>

<pre><code>{% extends "blog/base.html" %}
{% block header %}
&lt;header id="header"&gt;
***
&lt;/header&gt;
{% endblock %}
</code></pre>

<p>The output in the browser get the code:</p>

<pre><code>&lt;div id="main-container"&gt;
  &lt;!-- HEADER --&gt;

  &lt;!-- END HEADER --&gt;
</code></pre>

<p>Why not be able to extend the template?
Using <code>{% include "blog/header.html"%}</code> code inserted. using <code>extends</code> no.
Use Django 1.10.1</p>

<p><code>views.py</code></p>

<pre><code>from django.shortcuts import render
from django.utils import timezone
from .models import Post
from django.shortcuts import render, get_object_or_404

def post_list(request):
    posts = Post.objects.filter(published_date__lte=timezone.now()).order_by('published_date')
    return render(request, 'blog/index.html', {'posts': posts})

def post_detail(request, pk):
        post = get_object_or_404 (Post, pk=pk)
        return render(request, 'blog/base.html', {'post': post})

def header(request):
    return render(request, 'blog/header.html')
</code></pre>

<p>Through
<code>{% include "blog/header.html" %}</code> works. So the way spelled out correctly.</p>

<p>Thought the error here:</p>

<p><code>def header(request):
    return(request, 'blog/header.html')</code></p>

<p><code>def header(request):
    render(request, 'blog/header.html')</code></p>

<p><code>def header(request):
    return render_to_response (request, 'blog/header.html')</code></p>

<p>Not working (((</p>

<p>If you want to extend some template, you should render template with {% extends ... %} tag (in your case header.html), if you want to include something to renedered template, you should use {% include ... %} tag. You can make new template for particular page and ovreload {% block head %}, for example:</p>

<p>base.html:</p>

<pre><code>{% block header %}
{% include 'std_header.html' %}
{% endblock %}

{% block content %}
{% endblock %}

{% block footer%}
{% endblock %}
</code></pre>

<p>And particular page, for example landing page will overload default header:</p>

<p>landing.html:</p>

<pre><code>{% extends 'base.html' %}

{% block header %}
{% include 'landing_header.html' %}
{% endblock %}

{% block content %}
&lt;!-- landing page content --&gt;
{% endblock %}
</code></pre>

<p>So for view called landing_page you have to render landing.html template.</p>

python django templates