Created
June 20, 2019 06:29
-
-
Save manjurulhoque/84659f95bb4556bc8a38f25bd9a78e41 to your computer and use it in GitHub Desktop.
Send SMS Message using Twilio - Django
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from twilio.rest import Client | |
from django.conf import settings | |
from django.http import HttpResponse | |
def send_sms(request): | |
message = 'Add Your Message Here' | |
from = 'Your Twilio Number Here' | |
to = 'Reciever Phone Number' | |
client = Client(settings.TWILIO_ACCOUNT_SID, settings.TWILIO_AUTH_TOKEN) | |
response = client.messages.create(body=message, to=to, from_=from_) | |
return HttpResponse("SMS Sent") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment