title: Django how to use blocks in templates
body: <p>Basicly my django project consists of the templates with html.
  I would like to fill the context of the site using blocks.
  My problem is that I would like to send the block to sidebar and the base part of the page from application's .html files.</p>
  <pre><code>Templates:
  sidebar.html
  footer.html
  header.html
  base.html
  
  In my base.html I use:
  
  
      {% include 'partials/_sidebar.html' %}
      
      {% block content %}{% endblock %}
  
  
  in my sidebar.html I use
  
      {% block sidebar %}{% endblock %}
  
  and in my Application index.html i try to use:
  
  
      {% extends 'base.html' %}
      {% load static %}
      
      {% block content %}
      &lt;h1&gt;Home Page&lt;/h1&gt;
      
      {% endblock %}
      
      {% block sidebar %}
      &lt;div class=&quot;bg-white py-2 collapse-inner rounded&quot;&gt;&lt;/div&gt;
          &lt;h6 class=&quot;collapse-header&quot;&gt;Custom Components:&lt;/h6&gt;
              &lt;a class=&quot;collapse-item&quot; href=&quot;{% url 'veggies' %}&quot;&gt;veggies&lt;/a&gt;
              &lt;a class=&quot;collapse-item&quot; href=&quot;{% url 'fruits' %}&quot;&gt;fruits&lt;/a&gt;
      &lt;/div&gt;
      {% endblock %}
  
  But it is obviously not working. 
  The starting page triggers app/index.html with a view.
  
  How to workaround such a problem? 
  
  [i cant add post][1]
  
  
    [1]: https://i.stack.imgur.com/FV3Co.png
  </code></pre>