title: How to realize a dynamic sidebar with Django?
body: <p>I plan on creating a sidebar with changing elements (depending on the current url and authentication-status).</p>
  
  <p>For example: The default sidebar shows a login and a tag cloud.</p>
  
  <ul>
  <li>If a user is already logged in, I want to display a user menu.</li>
  <li>If the current url is <code>/tagcloud</code>, I want to hide it from the sidebar.</li>
  </ul>
  
  <p>Actually, I need a way which enables me to do something like this in a view:</p>
  
  <pre><code>def some_view(request):
      if request.user.is_authenticated():
          sidebar.remove('login')
          sidebar.add('user_menu')
  
  def tag_cloud(request):
      sidebar.remove('tag_cloud')
  </code></pre>
  
  <p>Afterwards, I want to pass the <code>sidebar</code> (implicitly, without passing it to <code>render_to_response</code>) to the template where I have in mind to do something like this:</p>
  
  <pre><code>&lt;div id="sidebar"&gt;
      {{ sidebar }}
  &lt;/div&gt;
  </code></pre>
  
  <p>Is this possible?</p>