Welcome to the Tangelo, the Web Application Platform for Python Programmers! — Tangelo Web Framework 0.10.0 documentation

# Welcome to the Tangelo, the Web Application Platform for Python Programmers!

Tangelo is a web application driver, implemented as a special-purpose webserver built on top of CherryPy. Tangelo paves the way for you to use HTML5, CSS, JavaScript, and other web technologies such as jQuery, D3, Bootstrap, WebGL, Canvas, and Vega to create rich web applications - from traditional, static pages, to cutting-edge, visual, dynamic displays.

But Tangelo also considers Python scripts to be part of your application, alongside your HTML and JavaScript files, running them on your behalf to do anything from retrieving a few database results for display, to engaging with powerful computational engines such as Hadoop to compute complex results. In other words, Tangelo reimagines the web application by making Python a first-class citizen, effortlessly integrating your Python code into your web applications without your having to adapt to complex web frameworks, worry about routing, or engage in the busy work of putting up application scaffolding.

To help in creating these newly enriched web applications, Tangelo exports the Tangelo API, a collection of Python and JavaScript functions, standard plugins, and the means to create custom plugins of your own, to create your own Tangelo applications.

This document describes all the pieces that fit together to make Tangelo work.

Please visit the Tangelo homepage and GitHub repository, and read our ongoing blog series for more information.

## Getting Started

### Quick Start

1. Make sure you have Python 2.7 and Pip installed (on Linux and OS X systems, your local package manager should do the trick; for Windows, see here).

2. Open a shell (e.g. Terminal on OS X; Bash on Linux; or Command Prompt on Windows) and issue this command to install the Tangelo package:

       pip install tangelo

   (On UNIX systems you may need to do this as root, or with `sudo`.)

3. Issue this command to start Tangelo, serving the example pack:

       tangelo --examples

4. Visit your Tangelo instance at http://localhost:8080.

### Hello World

Follow these steps to create an extremely simple Tangelo application:

    $ mkdir hello
    $ cd hello
    $ vim helloworld.py

    import datetime

    def run():
        return "hello, world - the current time and date is: %s\n" % (datetime.datetime.now())

    $ tangelo --port 8080
    $ curl http://localhost:8080/helloworld

    hello, world - the current time and date is: 2015-03-31 14:29:44.29411

### Diving Deeper

- To tinker with the Tangelo examples directly, see Fiddling with the Bundled Examples.
- To learn how to create your own Tangelo application from scratch, see Building a Tangelo Web Application from Scratch and the other tutorials.

## Using Tangelo

- Installation
  - Installing from the Python Package Index
  - Building and Installing from Source
- Setup and Administration
  - Configuring and Launching Tangelo
  - Administering a Tangelo Installation
  - A Note on Version Numbers
- Basic Usage
  - Serving Web Content
  - HTTP Authentication
- Tangelo Web Services
  - General Services
  - HTTP Status Codes
  - RESTful Services
  - Configuring Web Services
  - Persistent Storage for Web Services
- Tangelo Plugins
  - Structure and Content
  - Setup and Teardown
  - Plugin Configuration
  - Loading and Unloading

## Tutorials

- Building a Tangelo Web Application from Scratch
  - String Reverser
- Driving a Visualization with SQLAlchemy
  - Getting the Data
  - Creating the Database
  - Writing Data Services
  - Designing a Web Frontend
  - Putting It All Together
- Fiddling with the Bundled Examples
  - The Example Web Applications
  - Making a Copy

## Command Line Utilities

- `tangelo`
  - Example Usage
- `tangelo-passwd`
  - Example Usage

## The Tangelo API

- Python Web Service API
  - Core Services
  - HTTP Interaction
  - Web Services Utilities
- Tangelo JavaScript Library
- Bundled Plugins
  - Core Plugins
  - Utilities
  - Data Management and Processing
  - Visualization

## Information for Developers

- Coding Style Guidelines
  - Code Style Rules
  - Code structure
  - A note on `try...catch` blocks
  - A note on “eval is evil”
- Creating Tangelo Releases
  - Release Procedure
  - Summary
- Developing Visualizations
  - Creating jQuery Widgets
  - Visualization Options
  - Accessor Specifications

## Indices and tables

- Index
- Search Page