Create a gist now

Instantly share code, notes, and snippets.

A simple Twilio and Flask App
from flask import Flask, render_template, request
from twilio.rest import TwilioRestClient
app = Flask(__name__)
account = "MY_ACCOUNT_SID"
token = "MY_ACCOUNT_TOKEN"
client = TwilioRestClient(account, token)
@app.route('/')
def SendSMS():
message = client.sms.messages.create(to="MY_NUMBER", from_="MY_TWILIO_NUMBER",
body="Hello, World!")
return "Success"
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment