I am new to PythonAnywhere and Twilio. I am trying to run the following in a Python 2.7 console in PythonAnywhere:
from twilio.rest import TwilioRestClient
account_sid = "A*****************************5"
auth_token = "6**********************************8"
client = TwilioRestClient(account_sid, auth_token)
message = client.messages.create(to="+6*************1", from_="+6***********5",
body="Hello there again!")
This works when I run it locally, but not on PythonAnywhere. I get the following error message: socket.error: [Errno 111] Connection refused
I have tried changing "client.messages.create" to "client.sms.messages.create" But this has no effect (I also saw in previous posts that using Python 2.7 is good, and that I could update PythonAnywhere's version of Twilio - done that too.). The virtualenv in running in PythonAnywhere from the same folder as this code.
Please can someone tell me what I am doing wrong?