views:

47

answers:

1

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!

A: 

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!