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
358 views
@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. 

voice.py", line 75, in login
  galx = re.search(r"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()
voice.login()

phoneNumber = "+919886185535"
if (phoneNumber == ""):
    print("Hi there")
    sys.exit(-1)

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

voice.send_sms(phoneNumber, text)

Source: https://gist.github.com/AndrewNeo/1081363

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  settings.py ...READ MORE

answered Feb 25 in Python by SDeb
• 9,380 points
39 views
0 votes
1 answer

how to download and install Django rest framework?

To install Django, you can simply open ...READ MORE

answered Apr 24, 2018 in Python by Christine
• 15,790 points
68 views
0 votes
1 answer

How to exit from Python without traceback?

shutil has many methods you can use. One ...READ MORE

answered May 10, 2018 in Python by charlie_brown
• 7,710 points
79 views
0 votes
1 answer

How to get text label from SAP using pywinauto[python]

Hi. Can you please tell me what ...READ MORE

answered Jun 28, 2018 in Python by Nietzsche's daemon
• 4,260 points
203 views
0 votes
1 answer

How to exit from Python without traceback?

Perhaps you're trying to catch all exceptions ...READ MORE

answered Jul 31, 2018 in Python by Priyaj
• 56,120 points
160 views
0 votes
1 answer

How to find index from raw and column in python?

You probably want to use np.ravel_multi_index: import numpy as ...READ MORE

answered Sep 12, 2018 in Python by Priyaj
• 56,120 points
47 views
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,500 points

edited Dec 18, 2018 by Nymeria 249 views
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.