This application example demonstrates how to implement Account Verification on a Python Flask application using Authy.
Create a free Authy account, if you don't have one already, and then connect it to your Twilio account.
This project is built using the Flask web framework. For now, it only runs on Python 2.7 (not 3.4+).
-
To run the app locally, clone this repository and
cd
into its. -
Create a new virtual environment:
-
If using vanilla virtualenv:
virtualenv venv source venv/bin/activate
-
If using virtualenvwrapper:
mkvirtualenv account-verification-flask
-
-
Install the requirements.
pip install -r requirements.txt
-
Edit the folowing keys/values for the
config.py
file inside theaccount_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://'
-
Run the migrations.
python manage.py db upgrade
-
Start the development server.
python manage.py runserver
-
Go to http://127.0.0.1:5000/.
That's it!
You can run the tests locally through coverage.
-
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
.
- No warranty expressed or implied. Software is as is. Diggity.
- MIT License
- Lovingly crafted by Twilio Developer Education.