title: templatetags and context['request']
body: <p>So i'm learning Wagtail and trying to understand how to generate menus. So far i've found the <a href="https://github.com/wagtail/bakerydemo" rel="nofollow noreferrer">bakerydemo repo</a> helpful. One major point of confusion for me is understanding how to use the templatetags used for menus in the bakery demo. Below is the code for the get_site_root tag (<a href="https://docs.djangoproject.com/en/1.11/howto/custom-template-tags/#s-assignment-tags" rel="nofollow noreferrer">django docs recommend that as of 1.11 that simple_tag will also work</a> and so I changed it to that.)</p>
  
  <pre><code>@register.assignment_tag(takes_context=True)
    def get_site_root(context):
     # This returns a core.Page. The main menu needs to have 
     # the site.root_page
     #defined else will return an object attribute error ('str' object 
     #has no attribute 'get_children')
     return context['request'].site.root_page
  </code></pre>
  
  <p>No matter what I do I can't seem to get this to work. Either nothing is returned or I get various errors like the request key isn't in context or others. I looked at the <a href="https://github.com/wagtail/wagtail/blob/master/wagtail/wagtailcore/middleware.py" rel="nofollow noreferrer">Site middleware</a> then traced that to the site model staticmethod "find_for_request" which in turn should be calling <a href="https://github.com/wagtail/wagtail/blob/master/wagtail/wagtailcore/sites.py" rel="nofollow noreferrer">"get_site_for_hostname" in the sites.py</a> . Anyways, I would love some guidance on what I am doing wrong or misunderstanding. Also, any help in understading the "wagtailthonic" way of generating menus from page hierarchies would be welcome. </p>
  
  <p>Here is an image of the page and site tables.</p>
  
  <p><a href="https://i.stack.imgur.com/nqNGN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nqNGN.png" alt="wagtail site and page tables"></a></p>