Forums

Twilio script not working?

Hi,

I created a script that sends an SMS with twilio which runs perfectly on my computer, but won't run on PythonAnywhere (let alone be scheduled, which is what I really want).

Are there any considerations I should take with using twilio with PythonAnywhere?

I have the latest version of Twilio, incase that matters.

Thanks!

Hmm,

I read an earlier thread that says that Twilio is blocked by the proxy settings in the free accounts. Does that mean that you can't execute Twilio at all? I was planning to do a lunch and learn session at work. I guess I'll have to figure something else out.

I'm not sure -- is this the thread you read? If so, the problem was a bug in the Twilio library that meant that it ignored proxy settings, so it didn't work on PythonAnywhere. It's possible that they've fixed it in the meantime.

What was the error message that you were getting when you tried to run your script?

Hi Giles,

When I run the script, I don't get a text message. When I schedule the script, I get a return message of 0, but still no text message is returned. As far as I know, no errors are thrown.

That's very odd. If it was a problem with the proxy then I'd certainly expect an error to be thrown. Could I take a look at the code? (We can see your files from our side, but always ask permission first.)

Absolutely, the script is raptors.py

Thanks! That certainly looks like it should either work or print a message. What do you get if you print message.sid?

It turned out there were some problems with twilio under Python 2.7 from free accounts. We've just upgraded the package, so it should work now.