ETA notifications implementation with Python - Flask and Twilio.
This project is built using the Flask web framework. It runs on Python 2.7+ and Python 3.4+.
To run the app locally, first clone this repository and cd
into its directory. Then:
-
Create and activate a new python3 virtual environment.
python3 -m venv venv source venv/bin/activate
-
Install the requirements:
pip install -r requirements.txt
-
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.
-
Run the migrations with:
python manage.py db upgrade
-
Modify seed data:
We have provided an example of name and phone number in the seed data. In order for the application to send sms notifications, you must edit this seed data providing a real phone number where you want the sms notifications to be received.
In order to do this, you must modify this file that is located at:
project_root/manage.py
-
Seed the database:
python manage.py dbseed
-
Expose your application to the wider internet using ngrok. You can click here for more details. This step is important because the application won't work as expected if you run it through localhost.
ngrok http 5000
-
Start the development server:
python manage.py runserver
Once Ngrok is running, open up your browser and go to your Ngrok URL. It will
look like this: http://9a159ccf.ngrok.io
That's it!
python manage.py test
- No warranty expressed or implied. Software is as is. Diggity.
- MIT License
- Lovingly crafted by Twilio Developer Education.