Example IVR System with Python, Django, Pytest and Twilio
Source code for the article series posted on the Twilio blog:
Clone project
$ git clone git@github.com:hakib/twilio-ivr-test.git
Setup using Make
$ make setup
This will create the virtual environment, install all the requirements and run the tests. Alternatively, you can setup the project manually.
Create virtual environment
$ cd twilio-ivr-test
$ python3 -m venv venv
$ source venv/bin/activate
Install dependencies
$ pip install --upgrade pip
$ pip install -r requirements.txt
$ pip install -r requirements-dev.txt
Run migrations
$ python ivr/manage.py migrate
Run project (you’ll need a twilio account and a secret auth token to accept calls)
$ TWILIO_AUTH_TOKEN=my-twilio-secret-token ivr/manage.py runserver
Run Tests
$ pytest ivr
Run mypy
$ mypy ivr