# Bottle: Python Web Framework
Bottle is a fast, simple and lightweight WSGI (opens new window) micro web-framework for Python (opens new window). It is distributed as a single file module and has no dependencies other than the Python Standard Library (opens new window).
- Routing: Requests to function-call mapping with support for clean and dynamic URLs.
- Templates: Fast and pythonic built-in template engine and support for mako (opens new window), jinja2 (opens new window) and cheetah (opens new window) templates.
- Utilities: Convenient access to form data, file uploads, cookies, headers and other HTTP-related metadata.
- Server: Built-in HTTP development server and support for paste (opens new window), fapws3 (opens new window), bjoern (opens new window), Google App Engine (opens new window), cherrypy (opens new window) or any other WSGI (opens new window) capable HTTP server.
Example: “Hello World” in a bottle
from bottle import route, run, template
@route('/hello/<name>')
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 via PyPI (opens new window) (easy_install -U bottle) or download bottle.py (opens new window) (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.