All Projects → TwilioDevEd → automated-survey-django

TwilioDevEd / automated-survey-django

Licence: other
A sample app for automated phone surveys with Twilio, TwiML, Python and Django

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to automated-survey-django

human-call-filter
Captcha for phone calls
Stars: ✭ 41 (-22.64%)
Mutual labels:  twilio-voice
client-quickstart-php
Twilio Client Quickstart App
Stars: ✭ 21 (-60.38%)
Mutual labels:  twilio-voice
browser-calls-laravel
A sample application which shows you how to make and receive phone calls with a browser and Twilio Client
Stars: ✭ 29 (-45.28%)
Mutual labels:  twilio-voice
react-native-twilio-phone
Twilio Voice React Native module.
Stars: ✭ 124 (+133.96%)
Mutual labels:  twilio-voice
clicktocall-node
Node.js Click To Call Demo
Stars: ✭ 34 (-35.85%)
Mutual labels:  twilio-voice
ivr-phone-tree-laravel
Create an IVR phone tree with PHP and Laravel 5
Stars: ✭ 17 (-67.92%)
Mutual labels:  twilio-voice
phone-captcha
📱 Block robocalls with captcha for phone calls
Stars: ✭ 32 (-39.62%)
Mutual labels:  twilio-voice
survey-node
Automated surveys via text and voice in Node.js with Express and MongoDB
Stars: ✭ 37 (-30.19%)
Mutual labels:  twilio-voice
browser-calls-flask
A sample application which shows you how to make and receive phone calls with a browser and Twilio Client
Stars: ✭ 14 (-73.58%)
Mutual labels:  twilio-voice

Automated surveys (Django)

Build Status

Use Twilio to conduct automated phone surveys.

Read the full tutorial!

Quickstart

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 running the application in production somewhere, you need to point Twilio to http://<your-app-name>.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 automated_survey/tests/ --cov=automated_survey

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].