Run the Flask Server

Before you can start your server, you’ll need to provide configuration in a .env file. Start with the following and fill in your details:

Now start your app with:

Now if you load http://localhost:5000/, you should see something like this:

SMS Flask application window, showing fields for phone number and message

How to Send SMS Messages with Python, Flask and Nexmo

This tutorial introduces you to sending SMS with Python, making use of the Nexmo Python library. It starts by showing how to send SMS from the REPL, then goes on to show you how to build a simple flask app with SMS capabilities.

手順
1
Introduction to this tutorial
2
Prerequisites
3
Install the Vonage Python Server SDK
4
Send an SMS from the Python REPL
5
Set up an SMS Sending Flask App
6
Add a Send SMS View
7
Run the Flask Server
8
Handle the Form Post
9
What's next?