django block not showing

I want to add a navbar, messages and the content to the base.html, is this the right way to do it? I also want the profile to be as an extension of navbar so when you hover on profile buttton from navbar profile pops up. For now, I cannot see the navbar with block, but it work with include.

base.html

  {% block nav %}'
  {% endblock nav%}
  {% block messages %}
  {% endblock messages %}
  {% block content %}
  {% endblock content %}

navbar.html, should I use here include profile or a profile block?

{% extends 'app/base.html' %}
{% block nav%}
// some more code here..
<li class="nav-item dropdown position-static">
    <a class="nav-link dropdown-toggle" href="#" id="dropdown04" data-toggle="dropdown"
    aria-haspopup="true" aria-expanded="false">Profile</a>
                            <div class="dropdown-menu p-4" aria-labelledby="dropdown04">
                                {% include 'users/profile.html' %}
                            </div>
                        </li>
{% endblock nav%}

messages.html

{% extends 'app/base.html' %}
{% block messages %}

{% if messages %}
{% for message in messages %}
<div class="alert alert-{{ message.tags }}">
    {{ message }}
</div>
<div class="swal2-icon swal2-error swal2-animate-error-icon" style="display: flex;"><span class="swal2-x-mark"><span class="swal2-x-mark-line-left"></span><span class="swal2-x-mark-line-right"></span></span>
</div>
{% endfor %}
{% endif %}

{% endblock messages %}

Answer

If you want to declare a coding block in the template that can be overridden by a child template, you can use block tag-

{% block sidebar %}
<ul>
    <li><a href="/">Home</a></li>
    <li><a href="/blog/">Blog</a></li>
</ul>
{% endblock %}

On the other hand, If you want to load a template inside other template you should use include tag.

{% include "nav.html" %}

You don’t have to put the include tag inside a block tag if you don’t want to use different navbar for different templates. So in your case-

{% include "nav.html" %}

{% block messages %}
{% if messages %}
{% for message in messages %}
<div class="alert alert-{{ message.tags }}">
    {{ message }}
</div>
<div class="swal2-icon swal2-error swal2-animate-error-icon" style="display: flex;"><span class="swal2-x-mark"><span class="swal2-x-mark-line-left"></span><span class="swal2-x-mark-line-right"></span></span>
</div>
{% endfor %}
{% endif %}
{% endblock messages %}

{% block content %}
{% endblock content %}