0

I'm looking to send an SMS with the Twilio api, but I'm getting the following error:

"unknown url type: https"

I've recompiled python with Openssl, so my code runs fine from the python interpretor, but whenever I try to run it in one of my django views I get this error. Here is my code from my view:

def send_sms(request):
  recipient = '1234567890'
  account = twilio.Account(settings.TWILIO_ID, settings.TWILIO_TOKEN)
  params = { 'From': settings.TWILIO_NUM, 'To': recipient, 'Body': 'This is a test message.', }
  account.request('/%s/Accounts/%s/SMS/Messages' % (settings.TWILIO_API_VERSION, settings.TWILIO_ID), 'POST', params)

Edit- More info (thanks for bringing that up Stefan) The project is hosted on dreamhost via Passenger wsgi. Django is using the same python install location and interp.

I appreciate any insight anyone may have, thanks!

3
  • Check to see if your interpreter is a different python (version, install location) or if it is in a virtualenv. Could explain the symptoms. Commented Jul 2, 2010 at 23:13
  • Stefan you were absolutely right, it was a hosting issue. My wsgi file was using a different interpreter, but the paths were so similar I was just over looking it. Once I fixed that and copied django over everything worked perfect. Commented Jul 3, 2010 at 19:30
  • You should post this as an answer so we can upvote it! Commented Jul 5, 2010 at 16:54

1 Answer 1

1

Looks like it was just user error. My wsgi file was using a different interpreter but the paths were so similar I was just over looking it. Once I fixed that django was using the python version that I compiled with openssl and everything worked fine.

Always check if the tv is plugged in before you take it apart. Thanks stefanw!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.