Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

232
Visualizações
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'
about 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

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
    ) 
about 4 years ago · Santiago Trujillo Relatório

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
about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda