All Projects → TwilioDevEd → airtng-flask

TwilioDevEd / airtng-flask

Licence: MIT License
AirTNG - Rental-by-owner properties fit for a Captain, implemented in Python with Flask

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
CSS
56736 projects
Makefile
30231 projects
Mako
254 projects
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to airtng-flask

appointment-reminders-node
Node implementation of Appointment Reminders
Stars: ✭ 52 (+225%)
Mutual labels:  twilio-sms
survey-node
Automated surveys via text and voice in Node.js with Express and MongoDB
Stars: ✭ 37 (+131.25%)
Mutual labels:  twilio-sms
airtng-node
AirTNG - Rental-by-owner properties fit for a Captain, implemented with Node.js and Express
Stars: ✭ 43 (+168.75%)
Mutual labels:  twilio-sms
marketing-notifications-node
Demo application showing how to implement SMS notifications (for a mobile marketing use case) in Node.js
Stars: ✭ 13 (-18.75%)
Mutual labels:  twilio-sms
twilio flutter
A Flutter package for Twilio API.
Stars: ✭ 16 (+0%)
Mutual labels:  twilio-sms
appointment-reminders-csharp
Example App and Tutorial content for Appointment Reminders in C# | .NET
Stars: ✭ 16 (+0%)
Mutual labels:  twilio-sms
appointment-reminders-rails
A working Appointment Reminders sample built in Ruby on Rails
Stars: ✭ 36 (+125%)
Mutual labels:  twilio-sms

Airtng App: Part 1 - Workflow Automation with Python | Flask

This template is part of Twilio CodeExchange. If you encounter any issues with this code, please open an issue at github.com/twilio-labs/code-exchange/issues.

About

Learn how to automate your workflow using Twilio's REST API and Twilio SMS. This example app is a vacation rental site, where the host can confirm a reservation via SMS.

Read the full tutorial here!

Implementations in other languages:

.NET Java Node PHP Ruby
Done Done Done Done TBD

Set up

Requirements

  • python 3.6, 3.7 or 3.8 version

Twilio Account Settings

This application should give you a ready-made starting point for writing your own application. Before we begin, we need to collect all the config values we need to run the application:

Config Value Description
TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN You could find them in your Twilio Account Settings
TWILIO_NUMBER You can get one here

Local Development

  1. Clone this repository and cd into it.

    git clone [email protected]:TwilioDevEd/airtng-flask.git
  2. Install the requirements.

    make install
  3. Copy the sample configuration .env.example to .env, and then edit .env to match your configuration.

    cp .env.example .env

    See Twilio Account Settings to locate the necessary environment variables.

  4. Start the development server. Before running the following command, make sure the virtual environment is activated.

    make serve
  5. Check it out at http://localhost:5000

  6. To let our Twilio phone number use the callback endpoint we exposed, our development server will need to be publicly accessible. You could expose the application to the wider Internet using ngrok. Here, there is an interesting article about why we recommend you to use ngrok.

    ngrok http 5000

    Keep in mind that our endpoint is:

    http://<your-ngrok-subdomain>.ngrok.io/confirm
    
  7. You will need to configure Twilio to send requests to your application when SMS are received. You will need to provision at least one Twilio number with sms capabilities so the application's users can make property reservations. On Twilio Account Settings you could find the link to buy a Twilio number. Once you have a Twilio number you need to configure your number to work with your application. Open the number management page and open a number's configuration by clicking on it. Remember that the number where you change the SMS webhook must be the same one you set on the TWILIO_NUMBER setting.

    Configure Messaging

That's it!

Docker

If you have Docker already installed on your machine, you can use our docker-compose.yml to setup your project.

  1. Make sure you have the project cloned.
  2. Setup the .env file as outlined in the Local Development steps.
  3. Run docker-compose up.
  4. Follow the steps in Local Development on how to expose your port to Twilio using a tool like ngrok and configure the remaining parts of your application.

Tests

You can run the tests locally through coverage:

coverage run manage.py test

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

Cloud deployment

Additionally to trying out this application locally, you can deploy it to a variety of host services. Here is a small selection of them.

Please be aware that some of these might charge you for the usage or might make the source code for this application visible to the public. When in doubt research the respective hosting service first.

Service
Heroku Deploy

Resources

  • The CodeExchange repository can be found here.

Contributing

This template is open source and welcomes contributions. All contributions are subject to our Code of Conduct.

License

MIT

Disclaimer

No warranty expressed or implied. Software is as is.

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].