title: How do I create a request object in Django?
body: <p>So I'm using Django with Google App Engine and I have an urls.py file that redirects each url to a corresponding method. Each one of those methods is automatically passed "request" as one of the arguments, which I believe is an HttpRequest object. </p>
  
  <p>How do I create this populated request object from within my code? For example, if I'm within some method deep within my code, I'd like to have access to this request object without having to pass it to every function to make sure it's available. Assuming urls.py calls the method foo, the way I'm currently doing it is:</p>
  
  <pre><code>foo(request):
      # stuff here
      bar(request)
       # more stuff here
  
  bar(request):
       # stuff here&lt;stuff&gt;
      baz(request)
       # more stuff here
  
  baz(request):
      do something with request here
  </code></pre>
  
  <p>This seems wrong because I'm having to pass request through functions that don't need it just so that I have it available in baz. </p>
  
  <p>I'd like to do something like: </p>
  
  <pre><code>foo(request):
       # stuff here
      bar()
      # more stuff here
  
  bar():
       # stuff here
      baz()
       # more stuff here
  
  baz():
      request = HttpRequest()
      do something with request here
  </code></pre>
  
  <p>i.e. not pass request around if I don't have to. However, doing request = HttpRequest()
  returns an empty request object...what I want is a fully populated version, like what is passed into each method called from urls.py.</p>
  
  <p>I glanced through the documentation for HttpRequest here:
  <a href="http://docs.djangoproject.com/en/dev/ref/request-response/" rel="noreferrer">http://docs.djangoproject.com/en/dev/ref/request-response/</a>
  but didn't see the way to do it.</p>
  
  <p>Any thoughts would be greatly appreciated.</p>
  
  <p>Thanks,
  Ryan</p>