Hi guys,
My web app will connect to a national courier's API through requests lib for results. However I've been receiving [Errno 110] Connection timed out
2016-03-26 04:32:03,655 :Internal Server Error: /
Traceback (most recent call last):
File "/home/lotus92/.virtualenvs/django/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 149, in get_response
response = self.process_exception_by_middleware(e, request)
File "/home/lotus92/.virtualenvs/django/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 147, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/lotus92/poslaju/poslaju_web/tracking/views.py", line 19, in list
return process_manager.Poslaju(request.FILES['docfile'], result).main()
File "/home/lotus92/poslaju/poslaju_web/tracking/process_manager.py", line 81, in main
result = requests.get(request_url).content
File "/home/lotus92/.virtualenvs/django/local/lib/python2.7/site-packages/requests/api.py", line 67, in get
return request('get', url, params=params, **kwargs)
File "/home/lotus92/.virtualenvs/django/local/lib/python2.7/site-packages/requests/api.py", line 53, in request
return session.request(method=method, url=url, **kwargs)
File "/home/lotus92/.virtualenvs/django/local/lib/python2.7/site-packages/requests/sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "/home/lotus92/.virtualenvs/django/local/lib/python2.7/site-packages/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/home/lotus92/.virtualenvs/django/local/lib/python2.7/site-packages/requests/adapters.py", line 437, in send
raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='api.pos.com.my', port=80): Max retries exceeded with url: /v2TrackNTraceWebApi/api/Details/eg51613
2847my?callback=jQuery110204597350114595653_1458828384070&sKey=7oHHMvxM0&_=1458828384074 (Caused by NewConnectionError('<requests.packages.u
rllib3.connection.HTTPConnection object at 0x7fa45757b850>: Failed to establish a new connection: [Errno 110] Connection timed out',))
I'm a beginner in web app and I have been digging for the solution on Internet but until now no avail, can someone enlighten me on this issue please? The code works perfectly fine on my local environment though.
Thanks