GithubHelp home page GithubHelp logo

twilio / starter-python Goto Github PK

View Code? Open in Web Editor NEW
76.0 22.0 145.0 27 KB

A starter app for Python developers embarking on their first Twilio quest!

License: MIT License

Python 21.70% CSS 31.66% JavaScript 17.61% HTML 29.03%

starter-python's Introduction

Welcome to the Python Guild!

As members of the Python guild, you will be working through the challenges of TwilioQuest using the Python programming language. This project is pre-configured to do some interesting Twilio stuff using Python and the Flask web framework.

Setting Up

We assume that before you begin, you will have Python and pip installed on your system and available at the command line.

Before you can run this project, you will need to set three system environment variables. These are:

  • TWILIO_ACCOUNT_SID : Get it from your Twilio Console.
  • TWILIO_AUTH_TOKEN : Same as above.
  • TWILIO_PHONE_NUMBER : A Twilio number that you own, that can be used for making calls and sending messages. You can find a list of phone numbers you control (and buy another one, if necessary) in the console.

For Mac and Linux, environment variables can be set by opening a terminal window and typing the following three commands - replace all the characters after the = with values from your Twilio account:

    export TWILIO_ACCOUNT_SID=ACXXXXXXXXX
    export TWILIO_AUTH_TOKEN=XXXXXXXXX
    export TWILIO_PHONE_NUMBER=+16518675309

On Windows, the easiest way to set permanent environment variables (as of Windows 8) is using the setx command. Note that there is no =, just the key and value separated by a space:

    setx TWILIO_ACCOUNT_SID ACXXXXXXXXX
    setx TWILIO_AUTH_TOKEN XXXXXXXXX
    setx TWILIO_PHONE_NUMBER +16518675309

Running the application

  1. Clone this repository. Navigate to the folder with the source code on your machine in a terminal window.

  2. From there we recommend creating a virtualenv and activating it to avoid installing dependencies globaly on your computer.

    virtualenv -p python3 env source env/bin/activate

  3. Install dependencies:

    pip install -r requirements.txt

  4. Run the web app: python app.py

  5. Open the app in your browser

  6. Enter your mobile number in the fields provided, and test both SMS text messages and phone calls being sent to the mobile number you provide. The web UI should look something like this:

python guild

Begin Questing!

This is but your first step into a larger world. Return to TwilioQuest to continue your adventure. Huzzah!

starter-python's People

Contributors

atbaker avatar joliveros avatar kwhinnery avatar pkamp3 avatar smendes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

starter-python's Issues

Problem in Setting Up

I have followed all the steps listed in ReadMe. when i try to send a text message a popup appears
There was an error sending a request to the server :(

And this is printed on console

"HTTP Error Your request was:

POST /Accounts/{Account Sid}/Messages.json

Twilio returned the following information:

Unable to create record: A 'From' phone number is required.

More information may be available here:

https://www.twilio.com/docs/errors/21603"

Any hints why i am getting this error ?

Alternative easier code

Instead of setting environment variables that don't seem to work in most computers, a simpler solution is to globally declare a variable with the auth, sid, and phone number value. I can create a PR and make changes to the documentation in an easy to read format if required. Please do reply.

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.