Skip to content

tianshanghong/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.

About

An example implementation of click to call using Twilio and Flask.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 59.1%
  • HTML 32.8%
  • Python 6.9%
  • CSS 1.1%
  • Makefile 0.1%