Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

234
Views
AttributeError: 'module' object has no attribute 'TwilioRestClient'

Trying to integrate django 1.10 application with twilio 6.0.0 and django-twilio==0.8.0

referring link showing Error in my shell..

7 def send_twilio_message(to_number, body):
----> 8     client = twilio.rest.TwilioRestClient(
      9         settings.TWILIO_ACCOUNT_SID, settings.TWILIO_AUTH_TOKEN)
     10 

AttributeError: 'module' object has no attribute 'TwilioRestClient'
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Updated with the solution:
version twilio==6.0.0 (current one ) has different directory structure,so it effect importing structure
Below is the updated importing structure ..

from django.conf import settings

import twilio
import twilio.rest

from twilio.rest import Client 

def send_twilio_message(to_number, body):
    client = Client(settings.TWILIO_ACCOUNT_SID, settings.TWILIO_AUTH_TOKEN)

    return client.api.account.messages.create(
        body=body,
        to=to_number,
        from_=settings.PHONE_NUMBER
    ) 
over 4 years ago · Santiago Trujillo Report

0

The tutorial you are following was written for an older version of the twilio sdk than 6.0.

You could try to look for a newer tutorial to follow, or you could try to adjust the tutorial. The migration guide might help with this.

You final option is to install an older, unsupported version of the twilio library that works with the tutorial, e.g.

pip install twilio==5.7
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!