The main reason is that you are passing context from view in different html.
while extending other html the one you include or extend won't be able to access context which you passed in your template hence you need to override that particular block in template
You can work with templates as below:
base.html
{% block navbar %} base {% endblock %}
{% block body %} base {% endblock %}
Now if you render home.html
from view it should be:
home.html
{% extends 'base.html' %}
<!-- the blocks you override here only replaced -->
{% block navbar %}
{% for foo in subjectType %}
<li class="nav-item">
<a class="nav-link" href="{% url "type" foo.type_name %}">{{ foo.type_name }}</a>
</li>
{% endfor %}
{% endblock %}
So if you pass context using template home.html
you need to override navbar if you want to use context
Also you can create another html and include in template as:
navbar.html
{% for foo in subjectType %}
<li class="nav-item">
<a class="nav-link" href="{% url "type" foo.type_name %}">{{ foo.type_name }}</a>
</li>
{% endfor %}
home.html
{% extends 'base.html' %}
<!-- the blocks you override here only replaced -->
{% block navbar %}
{% include 'navbar.html' %}
{% endblock %}