Bottle: Python Web Framework

Bottle is a fast, simple and lightweight WSGI micro web-framework for Python with no external dependencies and packed into a single file.

Core Features

  • Routes: Mapping URLs to code with a simple but powerful pattern syntax.
  • Templates: Fast build-in template engine and support for mako, jinja2 and cheetah templates.
  • Server: Build-in HTTP development server and support for paste, fapws3, flup, cherrypy or any other WSGI capable server.
  • Plug&Run: All in a single file and no dependencies other than the Python standard library.

Download, Install and Dependencies

You can install the latest stable release with easy_install -U bottle or just download the newest testing version into your project directory. There are no (hard [1]) dependencies other than the Python standard library. Bottle runs with Python 2.5+ and 3.x (using 2to3)

Example

This is a minimal bottle application serving a single URL:

from bottle import route, run
@route('/')
def index():
    return 'Hello World!'
run(host='localhost', port=8080)

Documentation

Indices and tables

Footnotes

[1]Usage of the template or server adapter classes of course requires the corresponding template or server modules.

Table Of Contents

Next topic

How to start

This Page