Skip to content

Python/JS to give a click to call action button - POC for work

License

Notifications You must be signed in to change notification settings

gbshahaq/clicktocall-flask

Repository files navigation

Twilio

Click to Call with Flask

This is an application example implementing Click to Call using Twilio.

Build Status Coverage Status

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.

Read the full tutorial here!

Local development

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:

  1. Create a new virtual environment:

  2. Install the requirements:

    pip install -r requirements.txt
    
  3. 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.

  4. Run source .env to apply the environment variables (or even better, use autoenv)

  5. 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
  6. 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!

Testing

This app comes with a full testing suite ready for nose.

$ make test

Meta

  • 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:

  1. cd to working directory
  2. $ python3 -m venv venv (initial run only)
  3. $ source venv/bin/activate
  4. $ source .env
  5. $ make run
  6. (in a new shell) $ ngrok http 5000

About

Python/JS to give a click to call action button - POC for work

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published