title: how to show list of categories in navbar using django framework
body: <p><a href="https://i.stack.imgur.com/bMCYH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bMCYH.png" alt="enter image description here" /></a></p>
  <p>hello I want to list my categories in navbar from database but the navbar is a partial view and I included my navbar in base.html .
  how can i give the data to this navbar</p>
  <p>this is base.html that i included the partial view:</p>
  <pre><code>&lt;body&gt;
     {% include &quot;includes/navbar.html&quot; %}
  &lt;/body&gt;
  </code></pre>
  <p>this is partial view:</p>
  <pre><code>&lt;nav class=&quot;navbar navbar-expand-lg navbar-dark &quot;&gt;
      &lt;div class=&quot;container-fluid&quot;&gt;
          &lt;a class=&quot;navbar-brand text-dark&quot; href=&quot;#&quot;&gt;TechNerd&lt;/a&gt;
          &lt;button aria-controls=&quot;navbarSupportedContent&quot; aria-expanded=&quot;false&quot; aria-label=&quot;Toggle navigation&quot; class=&quot;navbar-toggler&quot;
                  data-bs-target=&quot;#navbarSupportedContent&quot; data-bs-toggle=&quot;collapse&quot; type=&quot;button&quot;&gt;
              &lt;span class=&quot;navbar-toggler-icon&quot;&gt;&lt;/span&gt;
          &lt;/button&gt;
          &lt;div class=&quot;collapse navbar-collapse&quot; id=&quot;navbarSupportedContent&quot;&gt;
              &lt;ul class=&quot;navbar-nav me-auto mb-2 mb-lg-0&quot;&gt;
                  &lt;li class=&quot;nav-item&quot;&gt;
                      &lt;a class=&quot;nav-link&quot; href=&quot;{% url 'post:posts' %}&quot;&gt;Posts&lt;/a&gt;
                  &lt;/li&gt;
                  &lt;li class=&quot;nav-item dropdown&quot;&gt;
                      &lt;a aria-expanded=&quot;false&quot; class=&quot;nav-link dropdown-toggle&quot; data-bs-toggle=&quot;dropdown&quot; href=&quot;#&quot;
                         id=&quot;navbarDropdown&quot; role=&quot;button&quot;&gt;
                          categories
                      &lt;/a&gt;
                      &lt;ul aria-labelledby=&quot;navbarDropdown&quot; class=&quot;dropdown-menu&quot;&gt;
                        &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;#&quot;&gt;Action&lt;/a&gt;&lt;/li&gt;
                        &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;#&quot;&gt;Action&lt;/a&gt;&lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/li&gt;
  
              &lt;/ul&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/nav&gt;
  </code></pre>