title: Template tag and request object
body: <p>Each time a request is made to my app, I am using middleware to retrieve and store a 'Page' object which has information relevant that particular page. I am storing a reference to this object in the request object, here is an example:</p>
  
  <pre><code>class PageMiddleware(object):
      def process_request(self, request):
          if not hasattr(request, 'page'):
              request.page = Page.objects.get(slug=&lt;slug&gt;)
          return None
  </code></pre>
  
  <p>It works well enough, but I want to access this object in a template tag. Template tags only have a reference to 'context' thought, meaning I am unable to see my Page object. </p>
  
  <p>I know I can use a custom context processor for this but that means modifying the settings file further and I'd like to try and keep this app as encapsulated as possible. I noticed, for example, that the Debug Toolbar app manages to append data to the template context without modifying the TEMPLATE_CONTEXT_PROCESSORS.</p>
  
  <p>In short, I want to access my Page object in a template tag ideally by just using middleware. Any ideas?</p>
  
  <p>Edit: I am using a standard template tag, with the following class:</p>
  
  <pre><code>class GetPageContentNode(Node):
      def __init__(self, key):
          self.key = key
  
      def render(self, context):
          return context['request'].page
  </code></pre>