title: Web proxy in python/django?
body: <p>I need to have a proxy that acts as an intermediary to fetch images. An example would be, my server requests domain1.com/?url=domain2.com/image.png and domain1.com server will respond with the data at domain2.com/image.png via domain1.com server.</p>
  
  <p>Essentially I want to pass to the proxy the URL I want fetched, and have the proxy server respond with that resource.</p>
  
  <p>Any suggestions on where to start on this?</p>
  
  <p>I need something very easy to use or implement as I'm very much a beginner at all of this.</p>
  
  <p>Most solutions I have found in python and/or django have the proxy acts as a "translater" i.e. domain1.com/image.png translates to domain2.com/image.png, which is obviously not the same.</p>
  
  <p>I currently have the following code, but fetching images results in garbled data:</p>
  
  <pre><code>import httplib2
  from django.conf.urls.defaults import *
  from django.http import HttpResponse
  
  def proxy(request, url):
      conn = httplib2.Http()
      if request.method == "GET":
          url = request.GET['url']
          resp, content = conn.request(url, request.method)
          return HttpResponse(content)
  </code></pre>