title: Django: creating/modifying the request object
body: <p>I'm trying to build an URL-alias app which allows the user create aliases for existing url in his website.</p>
  
  <p>I'm trying to do this via middleware, where the <code>request.META['PATH_INFO']</code> is checked against database records of aliases:</p>
  
  <pre><code>try:
      src: request.META['PATH_INFO']
      alias = Alias.objects.get(src=src)
      view = get_view_for_this_path(request)
  
      return view(request) 
  except Alias.DoesNotExist:
     pass
  
  return None
  </code></pre>
  
  <p>However, for this to work correctly it is of life-importance that (at least) the PATH_INFO is changed to the destination path.</p>
  
  <p>Now there are some snippets which allow the developer to create testing request objects (<a href="http://djangosnippets.org/snippets/2231/" rel="nofollow">http://djangosnippets.org/snippets/963/</a>, <a href="http://djangosnippets.org/snippets/2231/" rel="nofollow">http://djangosnippets.org/snippets/2231/</a>), but these state that they are intended for testing purposes.</p>
  
  <p>Of course, it could be that these snippets are fit for usage in a live enviroment, but my knowledge about Django request processing is too undeveloped to assess this.</p>