[Answered ]-KeyError exception type Django template tag

2👍

You are loading the tag, in the same template that is rendering the tag. This is why there is no context anymore.

The template that the tag renders app/TikSys/sidenavbar.html, should only have this:

<div class="col-md-2 NavBar">
    {% for item in menus %}
        <ul class="nav nav-pills nav-stacked">
            <li>{{ item.name }} </li>
    </ul>
    {% endfor %}
</div>

In the main template (where you need the menu), you add – at the top {% load load_menu %}, and then where you want the menu, you add {% menu %}, like this:

{% load load_menu %}
{% extends 'app/TikSys/tiksysbase.html' %}
{% block content %}
<div class="body-container">
  {% menu %}
  <div class="col-md-10 ">
     <div class="jumbotron">
        <h1>Welcome to TikSys!</h1>
        <p>Please Sign In</p>
     </div>
  </div>

Leave a comment