How to send sms to users from Django application

+5 votes
I'm looking for an option to send otp to users's registered mobile number irrespective of country when they login.

I tried with twilio(trial version) but it sends msgs from 9am to 9pm and also messages will be send only to a number verified by  twilio.

As per my understanding twilio doesn't support this feature for all countries. Any help appreciated.
Nov 13, 2018 in Python by Manu
• 170 points
@Manu yes you are correct Twilio sends message only to twilio verified numbers.

You can use Google service api known as pygooglevoice
Thanks Priyaj. I will try this.

I used pygooglevoice but I was getting below error.", line 75, in login
  galx ="type=\"hidden\"\s+name=\"GALX\"\s+value=\"(.+)\"", content).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

I tried few workarounds but it did not work. I implemented the functionality using Twilio Authy api.

Hey @Manu. I tried this and it worked:

import sys;
from googlevoice import Voice

voice = Voice()

phoneNumber = "+919886185535"
if (phoneNumber == ""):
    print("Hi there")

text = sys.argv[1:]
if (text == ""):
    print("You must specify a message.")

voice.send_sms(phoneNumber, text)

Hello Mr.Manu. I am facing the same problem with pygooglevoice. Could you please tell me how you implemented it using Twilio Authy api. Thank you.
@Manu the link that you sent has good content. How are you using it in your case?

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Python

0 votes
1 answer

How do you configure Django to send mail through Postfix?

You can do this by adding ...READ MORE

answered Feb 25, 2019 in Python by SDeb
• 13,300 points
0 votes
1 answer
0 votes
1 answer

How to send email via Django?

Hello @kartik, I use Gmail as my SMTP ...READ MORE

answered May 6, 2020 in Python by Niroj
• 82,880 points
0 votes
1 answer

How do I add a link from the Django admin page of one object to the admin page of a related object?

Hello @kartik, Set show_change_link to True (False by default) in your inline ...READ MORE

answered Jun 12, 2020 in Python by Niroj
• 82,880 points
0 votes
1 answer

How to execute a Python script from the Django shell?

Hello @kartik, The << part is wrong, use < instead: $ ./ shell ...READ MORE

answered Jun 22, 2020 in Python by Niroj
• 82,880 points
0 votes
1 answer

How to get the SQL from a Django QuerySet?

Hello @kartik, Try this in your queryset: print my_queryset.query For ...READ MORE

answered Jun 23, 2020 in Python by Niroj
• 82,880 points
0 votes
1 answer

How to get all related Django model objects in Python?

This actually gives you the property names ...READ MORE

answered Nov 14, 2018 in Python by Nymeria
• 3,560 points

edited Dec 18, 2018 by Nymeria 6,406 views
0 votes
1 answer
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP