title: How to access context variables in parents template django
body: <p>I have <code>base.html</code> and file with header <code>_header_main.html</code> in my main template <code>index.html</code> i extends <code>base.html</code> and include <code>_header_main.html</code> but variables that i pass into <code>index.html</code> not visible in parent template</p>
  
  <p><strong>base.html:</strong></p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;{% block title %}{% endblock %}&lt;/title&gt;
          &lt;!-- styles --&gt;
          ...
      &lt;/head&gt;
      &lt;body&gt;
          {% block _header_main %}{% endblock %}
          {% block _header_mobile %}{% endblock %}
          &lt;div class="wrapper"&gt;
          &lt;!-- header --&gt;
          {% block header_main %}{% endblock %}
          {% block header_mobile %}{% endblock %}
  
          &lt;div class="after_header"&gt;&lt;/div&gt;
      &lt;!-- end header --&gt;
      {% block content %}{% endblock %}
          &lt;footer class="footer"&gt;
              ...
          &lt;/footer&gt;
      &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>_header_main.html:</strong></p>
  
  <pre><code>&lt;header class="header"&gt;
      &lt;ul&gt;
      {% for i in servers %}
          &lt;li&gt;{{ i.title }}&lt;/li&gt;
      {% endfor %}
      &lt;/ul&gt;
  &lt;/header&gt;
  </code></pre>
  
  <p><strong>index.html:</strong></p>
  
  <pre><code>{% extends "base.html" %}
  {% load static %}
  {% block title %}Title{% endblock %}
  {% block header_main %}
      {% include "_header_main.html" %}
  {% endblock %}
  {% block content %}
      Some content...
  {% endblock %}
  &lt;scripts&gt;
  ...
  &lt;/scripts&gt;
  </code></pre>
  
  <p>How i can access to variables <code>items</code> in my template?</p>
  
  <p><strong>Edit. My function in views.py</strong></p>
  
  <pre><code>def index(request):
      servers = Server.objects.all().order_by('ranking')
      basket_count, total_price = basket_calculate(request)
      server_arr = [i.title for i in servers]
      servers_string = ', '.join(server_arr)
      return render(request, 'index.html', {'servers':servers, 'temp_year' : datetime.now().year,
                                            'basket_count':basket_count, 'total_price':total_price,
                                            'servers_string':servers_string })
  </code></pre>