Bottle: Python Web Framework



Example: “Hello World” in a bottle

from bottle import route, run, template

def index(name):
    return template('<b>Hello {{name}}</b>!', name=name)

run(host='localhost', port=8080)

Run this script or paste it into a Python console, then point your browser to http://localhost:8080/hello/world. That’s it.

Download and Install

Install the latest stable release with pip install bottle, easy_install -U bottle or download (unstable) 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.


Code and documentation are available according to the MIT License:



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