Python
Initialize your dependencies
In server.py, write the following code to initialize dependencies and define some variables which you will use to configure your application:
# server.py
from flask import Flask, render_template, session, request
import os
from os.path import join, dirname
from dotenv import load_dotenv
from vonage import Client, Verify
dotenv_path = join(dirname(__file__), "../.env")
app = Flask(__name__)
app.config["SECRET_KEY"] = "VonageVerify"
VONAGE_API_KEY = os.getenv("VONAGE_API_KEY")
VONAGE_API_SECRET = os.getenv("VONAGE_API_SECRET")
VONAGE_BRAND_NAME = os.getenv("VONAGE_BRAND_NAME")
# define your routes here
# run the server
if __name__ == "__main__":
app.run(debug=True)
Step-up Authentication
Add an extra layer of security when users perform sensitive tasks
手順
1
Introduction2
Create the Node.js application3
Initialize your dependencies4
Configure the application5
Define the routes6
Create the UI7
Display the home page8
Send the verification request9
Check the verification code10
Try it out!11
What's next?