How to get request token under proxy server?


#1

error at /settings/socialsettings/
[Errno 61] Connection refused
Request Method: GET
Request URL: http://localhost:9090/settings/socialsettings/?p=twitter
Django Version: 1.3.1
Exception Type: error
Exception Value:
[Errno 61] Connection refused
Exception Location: /Library/Python/2.7/site-packages/httplib2-0.7.3-py2.7.egg/httplib2/init.py in connect, line 890

code:

 request_token_url = "http://twitter.com/oauth/request_token"
consumer = oauth.Consumer(consumer_key, consumer_secret)
client = oauth.Client(consumer)
client.ca_certs = certifi.where()

resp, content = client.request(request_token_url, "GET")


if resp['status'] != '200':
    raise Exception("Invalid response %s." % resp['status'])
request_token = dict(urlparse.parse_qsl(content))
request.session['twittertoken'] = request_token
authorize_url = 'http://twitter.com/oauth/authorize?oauth_token=%s' % request_token['oauth_token']
return HttpResponseRedirect(authorize_url)

can anyone help me to handle that exception