title: Django - how to dynamically generate a menu based on use privs
body: <p>Does anyone know a good way to solve this other problem I have. My site shows menus based on a users privs. I have a function that returns the privs as a dictionary as below:</p>
  
  <pre><code>return {"manage_entries":True, "manage_members":False, 
     "manage_something_else":True}
  </code></pre>
  
  <p>I passed in each priv to my base template that includes the navigation bar and use simple <code>{% if priv %}</code> to decide if I am going to show the menu item or not. It works fine except...</p>
  
  <p>I need to pass the privs in the context of every view as they all include the base.html template and thus menu. There are lots of views so this is stupid. There must be a better way!</p>
  
  <p>Cheers</p>
  
  <p>Rich</p>