Use Twilio to send SMS reminders to your customers about upcoming appointments. Learn how appointment reminders help other companies in these Twilio customer stories.
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 using pip.
pip install -r requirements.txt
-
Copy the
.env.example
file to.env
and add the following values. Be sure to replace the placeholders and connection string with real information.SECRET_KEY = 'your_authy_secret_key' TWILIO_ACCOUNT_SID = '[your_twilio_account_sid]' TWILIO_AUTH_TOKEN = '[your_twilio_auth_token]' TWILIO_NUMBER = '[your_twilio_phone_number]'
-
Create Flask application variables
export FLASK_APP=reminders export FLASK_ENV=development
-
Run the migrations.
flask db upgrade
-
Start a redis server to be our Celery broker. If on a Mac, we recommend installing redis through homebrew If you already have docker installed in your system an easy way of get redis running is:
docker run -d -p 6379:6379 redis:latest
-
Start the development server:
flask run
You can now access the application at http://localhost:5000. To send any reminders, however, you must also start a separate Celery worker process.
-
Start a new terminal session,
cd
into the repository, and active yourappointment-reminders
virtualenv -
Activate Flask development environment
export FLASK_ENV=development
-
Start the Celery worker:
celery -A tasks.celery worker -l info
Celery will now send SMS reminders for any new appointments you create through the web app.
You can run the tests locally. Follow the instructions in the Local Development section above, and then run:
python runtests.py
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.