dimanche 20 octobre 2019

How to fix this error in flask send sms web app

i have error sens smsm with this web app flask

from flask import Flask, request,render_template
from twilio import twiml
from twilio.rest import Client

app = Flask(__name__)
client = Client(account_sid, auth_token)
account_sid = 'ACbde6101a18c7a57329503bd79a22158f'
auth_token = 'my TOKEN'

def homepage():
    return render_template('index.html')

@app.route('/index', methods=['POST','GET'])
def message():
    if request.method == 'POST':

        message = client.sms.messages.create(to=request.form['Phone_numbre'],from_='+1XXXXXXXX',body=request.form['body'])

    return render_template("index.html")


if __name__ == '__main__':
    app.run(debug=True)

ihave many error when I launch this web app (send SMS via a web form) i use api tiwlio




Aucun commentaire:

Enregistrer un commentaire