Skip to content

walkergitonga/video-service-django

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Customer Service with Twilio Video

This is an example application demonstration a customer service use case with Python and the Django web framework. In addition, this project contains other third-party modules in the requirements.txt file that may be useful in creating application with Twilio.

Deploy On Heroku

Deploy

When deploying from the commandline instead of the Heroku Deploy button, use the following commands from the root of the project directory.

    heroku create

    heroku config:set SECRET_KEY='something super secret'
    heroku config:set TWILIO_ACCOUNT_SID='ACxxxxxxxxxxxxxxxx'
    heroku config:set TWILIO_AUTH_TOKEN='xxxxxxxxxxxxxxxxxxx'
    heroku config:set DATABASE_URL='postgresql://user:passwd@localhost/videodjango'
    
    heroku addons:add heroku-postgresql

    git push heroku master

    heroku run python manage.py syncdb

Running the Project on Your Machine

Development environment requirements:

  1. Create a new virtualenv.

     virtualenv videodjango
     source videodjango/bin/activate
    
  2. Clone repository at https://github.com/TwilioDevEd/video-service-django

     git clone [email protected]:TwilioDevEd/video-service-django
    
  3. Change into the new directory.

     cd video-service-django
    
  4. Install local dependencies.

     pip install -r requirements.txt
    
  5. Set environment variables. Make sure to replace the values with your own environment settings.

     export DEBUG=True
     export SECRET_KEY='super secret key'
     export DATABASE_URL='postgresql://user:passwd@localhost/videodjango'
     export TWILIO_ACCOUNT_SID='ACxxxxxxxxxxxxxxxxxxxx'
     export TWILIO_AUTH_TOKEN='ACxxxxxxxxxxxxxxxxxxxx'
    
  6. Create database and schema.

     createdb videodjango
     python manage.py syncdb
    
  7. Run the app.

     python manage.py runserver
    

Open web browser and head to http://localhost:8000/ to see your local app running.

Exposing Webhooks to Twilio

You will likely need to expose your local Django web application on the public Internet to work with Twilio. We recommend using ngrok to accomplish this. Use ngrok to expose a local port and get a publicly accessible URL you can use to accept oncoming calls or texts to your Twilio numbers.

The following example would expose your local Django application running on port 8000 at http://meow-danger-cat.ngrok.com (reserved subdomains are a paid feature of ngrok):

ngrok -subdomain=meow-danger-cat 8000

License

MIT

About

Demo app showing video-powered customer service with Twilio for Python using the Django web framework.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 82.4%
  • HTML 15.7%
  • JavaScript 1.6%
  • CSS 0.3%