Skip to content

thepythongeek/account-verification-flask

 
 

Repository files navigation

Account Verification with Authy

Build Status

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 account, if you don't have one already, and then connect it to your Twilio account.

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 its.

  2. Create a new virtual environment:

    • If using vanilla virtualenv:

      virtualenv venv
      source venv/bin/activate
      
    • If using virtualenvwrapper:

      mkvirtualenv account-verification-flask
      
  3. Install the requirements.

    pip install -r requirements.txt
    
  4. Edit the folowing keys/values for the config.py file inside the account_verification_flask/ directory. Be sure to replace the connection string and place holders with real information.

    AUTHY_KEY = 'your_authy_key'
    
    TWILIO_ACCOUNT_SID = '[your_twilio_account_sid]'
    TWILIO_AUTH_TOKEN = '[your_twilio_auth_token]'
    TWILIO_NUMBER = '[your_twilio_phone_number]'
    
    SQLALCHEMY_DATABASE_URI = 'sqlite://'
    
  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

You can run the tests locally through coverage.

  1. Run the tests:

    $ coverage run manage.py test
    

You can then view the results with coverage report or build an HTML report with coverage html.

Meta

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

About

Authy Account Verification sample app implemented in Python | Flask

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 52.1%
  • JavaScript 26.4%
  • HTML 17.0%
  • CSS 3.5%
  • Mako 1.0%