Skip to content
This repository has been archived by the owner on Sep 14, 2021. It is now read-only.

TwilioDevEd/account-verification-flask

Repository files navigation

Important Notice

For new development, we encourage you to use the Verify API instead of the Authy API. The Verify API is an evolution of the Authy API with continued support for SMS, voice, and email one-time passcodes, an improved developer experience and new features.

Please visit the Verify Quickstarts Page to get started with the Verify API. Thank you!

Account Verification with Authy

Flask

This application example demonstrates how to implement Account Verification on a Python Flask application using Authy.

Read the full tutorial here!

Quickstart

Create an Authy app

Create a free Authy application, if you don't have one already.

Local development

This project is built using the Flask web framework. For now, it only runs on Python 2.7 (not 3.4+).

  1. To run the app locally, clone this repository and cd into it.

  2. Create and activate a new python3 virtual environment.

    python3 -m venv venv
    source venv/bin/activate
  3. Install the requirements.

    pip install -r requirements.txt
  4. Copy the sample configuration file and edit it to match your configuration.

    cp .env.example .env

    Twilio API credentials can be found here and find you can create a REST API Key here. If using the twilio CLI you can run:

    twilio api:core:keys:create --friendly-name=worm-transfer -o json

    Copy or create a Twilio phone number from here.

  5. Run the migrations.

    python manage.py db upgrade
  6. Start the development server.

    python manage.py runserver
  7. Go to http://127.0.0.1:5000/.

That's it!

Run the tests locally.

python manage.py test

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.