Giter Club home page Giter Club logo

call-tracking-django's Introduction

Call Tracking (Django)

Build Status Coverage Status

Use Twilio to track the effectiveness of your different marketing campaigns. Learn how call tracking helps organizations in these Twilio customer stories.

Read the full tutorial here!

Quickstart

Create a TwiML App

This project is configured to use a TwiML App, which allows us to easily set the voice URLs for all Twilio phone numbers we purchase in this app.

Create a new TwiML app at https://www.twilio.com/user/account/apps/add and use its Sid as the TWIML_APPLICATION_SID environment variable wherever you run this app.

Creating a TwiML App

You can learn more about TwiML apps here: https://www.twilio.com/help/faq/twilio-client/how-do-i-create-a-twiml-app

Heroku

The easiest way to run this app is by deploying it to Heroku. You can run this app for free in minutes:

Deploy

After your app deploys, you will need to update your TwiML app to use the Heroku server's hostname in the TwiML app's voice URL field. It will look something like this:

http://young-journey-3547.herokuapp.com/call-tracking/forward-call

Local development

This project is built using the Django 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. Start a local PostgreSQL database and create a database called call_tracking:

    • If on a Mac, I recommend Postgres.app. After install, open psql and run CREATE DATABASE call_tracking;
    • If Postgres is already installed locally, you can just run createdb call_tracking from a terminal
  4. Run the migrations with:

    python manage.py migrate
    
  5. Optionally create a superuser so you can access the Django admin:

    python manage.py createsuperuser
    
  6. Copy the .env_example file to .env, and edit it to include your Twilio API credentials (found at https://www.twilio.com/user/account/voice)

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

  8. Start the development server

    python manage.py runserver
    

To actually forward incoming calls, your development server will need to be publicly accessible. We recommend using ngrok to solve this problem.

Once you have started ngrok, update your TwiML app's voice URL setting to use your ngrok hostname, so it will look something like this:

http://88b37ada.ngrok.io/call-tracking/forward-call

Run the tests

You can run the tests locally through coverage:

$ coverage run manage.py test --settings=twilio_sample_project.settings.test

You can then view the results with coverage report or build an HTML report with coverage html.

call-tracking-django's People

Contributors

kwhinnery avatar malaklopez avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.