Giter VIP home page Giter VIP logo

automated-survey-django's Introduction

Automated surveys (Django)

Build Status

Use Twilio to conduct automated phone surveys.

Read the full tutorial!

Quickstart

Heroku

This project is preconfigured to run on Heroku. Deploy it now:

Deploy

To view your app, click the ... menu in the top right corner and select Open app.

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 it. Then:

  1. Create a new virtual environment:

    • If using vanilla virtualenv, run virtualenv venv and then source venv/bin/activate.
    • If using virtualenvwrapper, run mkvirtualenv automated-surveys.
  2. Install the requirements with pip install -r requirements.txt.

  3. Start a local PostgreSQL database and create a database called surveys.

    • If on a Mac, we recommend Postgres.app. After installing, run createdb surveys;.
    • If Postgres is already installed locally, you can just run createdb surveys from a terminal.
  4. Copy the .env.example file to .env, and edit it to match your database.

  5. Run the migrations with python manage.py migrate.

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

  7. Start the development server: python manage.py runserver.

Configure Twilio to call your webhooks

You will also need to configure Twilio to call your application when calls are received. To be able to do this you would need to to provision at least one Twilio number with voice capabilities so the application's users can take surveys. You can buy a number right here. Once you have a number you need to configure it to work with your application. Open the number management page and open a number's configuration by clicking on it. Open a number's configuration

Next, edit the "Request URL" field under the "Voice" section and point it towards your ngrok-exposed application /automated-survey/first-survey/ route. Set the HTTP method to POST. If you are trying the Heroku application you need to point Twilio to http://<your-app-name>.herokuapp.com/automated-survey/first-survey/.

See the images below as an example on how to do it:

You can then visit the application at http://localhost:8000/.

Mind the trailing slash.

Webhook Voice configuration

The same endpoint for Voice is being used for Messaging, so you can repeat this step on the Messaging section. Webhook SMS configuration

Run the tests

Configure your test database by editing .env.test file. You can then run the tests locally using py.test

$ py.test --cov=automated_survey

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.

automated-survey-django's People

Contributors

kathyguerron avatar kwhinnery avatar shyba avatar

Watchers

 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.