I have been trying to send an SMS with Twilio but its not working. It shows this error.
Traceback (most recent call last):
File "/home/dhruvsomani/sms.py", line 11, in <module>
body="Trial is a Trial.",
File "/usr/local/lib/python3.4/dist-packages/twilio/rest/resources/messages.py", line 122, in create
return self.create_instance(kwargs)
File "/usr/local/lib/python3.4/dist-packages/twilio/rest/resources/base.py", line 341, in create_instance
data=transform_params(body))
File "/usr/local/lib/python3.4/dist-packages/twilio/rest/resources/base.py", line 193, in request
resp = make_twilio_request(method, uri, auth=self.auth, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/twilio/rest/resources/base.py", line 148, in make_twilio_request
resp = make_request(method, uri, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/twilio/rest/resources/base.py", line 115, in make_request
resp, content = http.request(url, method, headers=headers, body=data)
File "/usr/local/lib/python3.4/dist-packages/httplib2/__init__.py", line 1292, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/usr/local/lib/python3.4/dist-packages/httplib2/__init__.py", line 1042, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/usr/local/lib/python3.4/dist-packages/httplib2/__init__.py", line 966, in _conn_request
conn.connect()
File "/usr/lib/python3.4/http/client.py", line 1223, in connect
super().connect()
File "/usr/lib/python3.4/http/client.py", line 834, in connect
self.timeout, self.source_address)
File "/usr/lib/python3.4/socket.py", line 512, in create_connection
raise err
File "/usr/lib/python3.4/socket.py", line 503, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
What should I do? Is this due to the security causes of PythonAnywhere? Please tell me how I should proceed. I am using the lates version of Twilio.