title: How to use Python proxy server when getting [Errno 111] Connection refuse
body: <p>I try to test <a href="https://www.odoo.com/documentation/10.0/api_integration.html" rel="nofollow noreferrer">Odoo Web Service API</a> from Python and everything works fine from localhost using a basic Django app and xmlrpclib. But when I <a href="http://geko.pythonanywhere.com/odooapp" rel="nofollow noreferrer">host it</a> at pythonanywhere I get a <em>[Errno 111] Connection refused</em> error:</p>
  
  <p><a href="https://i.stack.imgur.com/Bh30Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bh30Y.png" alt="enter image description here"></a></p>
  
  <p>On their help page <a href="https://help.pythonanywhere.com/pages/403ForbiddenError/" rel="nofollow noreferrer">they describe</a> that ports are closed on free accounts and that their HTTP proxy at <strong>proxy.server:3128</strong> has to be used. How to do that?</p>
  
  <p>Actually it should work without the proxy once the add <em>.odoo.com</em> to their <a href="https://www.pythonanywhere.com/whitelist/" rel="nofollow noreferrer">whitelist</a>, but the proxy issue is interesting for me also to know how to run this app on a different hosting.</p>
  
  <p>Here is the Django code of my view (yes I know that's bad practice to put html in the view, just for testing):</p>
  
  <pre><code>from django.http import HttpResponse
  import xmlrpclib
  
  url = "https://demo3.odoo.com"
  db = "demo_100_1489044950"
  username = "admin"
  password = "admin"
  
  #odoo service connection
  common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(url))
  uid = common.authenticate(db, username, password, {})
  models = xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format(url))
  products = models.execute_kw(db, uid, password,
      'product.template', 'search_read',
      [[]],
      {'fields': ['name', 'list_price'], 'limit': 10})
  
  for product in products:
      print product['id'], product['name'], product['list_price']
  
  def index(request):
      html = "&lt;html&gt;&lt;body&gt;&lt;h1&gt;Odoo Products&lt;/h1&gt;"
      for product in products:
          name = product['name'].encode("utf-8", "strict")
          html += "&lt;div&gt;"+name+": "+str(product['list_price'])+"&lt;/div&gt;"
      html += "&lt;/body&gt;&lt;/html&gt;"
      return HttpResponse(html)
  </code></pre>
  
  <p>ps: Source code of Django app is in <a href="https://github.com/geraldo/odooapi" rel="nofollow noreferrer">this github repository</a></p>