Skip to content

Instantly share code, notes, and snippets.

@manjurulhoque
Created June 20, 2019 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manjurulhoque/84659f95bb4556bc8a38f25bd9a78e41 to your computer and use it in GitHub Desktop.
Save manjurulhoque/84659f95bb4556bc8a38f25bd9a78e41 to your computer and use it in GitHub Desktop.
Send SMS Message using Twilio - Django
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