When you want to use external html file, here are some tips.
Working with Include Tag in Django
- First, create a navbar.html using following code.
<nav>
<ul>
<li><a href="#">Home</a> </li>
<li><a href="#">Contact</a> </li>
<li><a href="#">News</a> </li>
</ul>
</nav>
-
And then, modify code in base.html using
include
clause:{% include 'navbar.html' %}
. -
Refresh your page, you will see this result.