This is an application example implementing Click to Call using Twilio.
We are currently in the process of updating this sample template. If you are encountering any issues with the sample, please open an issue at github.com/twilio-labs/code-exchange/issues and we'll try to help you.
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 a new virtual environment:
-
If using vanilla virtualenv:
virtualenv venv source venv/bin/activate
-
If using virtualenvwrapper:
mkvirtualenv clicktocall-flask
-
-
Install the requirements:
pip install -r requirements.txt
-
Copy the
.env.example
file to.env
, and edit it including your credentials for the Twilio API (found at https://www.twilio.com/user/account/settings). You will also need a Twilio Number. -
Run
source .env
to apply the environment variables (or even better, use autoenv) -
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:
make run
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!
This app comes with a full testing suite ready for nose.
$ make test
- No warranty expressed or implied. Software is as is. Diggity.
- MIT License
- Lovingly crafted by Twilio Developer Education.
PS For the Bitnami MEAN stack, slight change to getting the virtual env to run:
- cd to working directory
- $ python3 -m venv venv (initial run only)
- $ source venv/bin/activate
- $ source .env
- $ make run
- (in a new shell) $ ngrok http 5000