Permalink
Fetching contributors…
Cannot retrieve contributors at this time
executable file 119 lines (80 sloc) 3.46 KB
.. currentmodule:: bottle

Bottle: Python Web Framework

Bottle is a fast, simple and lightweight WSGI micro web-framework for Python. It is distributed as a single file module and has no dependencies other than the Python Standard Library.

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 with pip install bottle or download bottle.py (unstable) into your project directory. There are no hard [1] dependencies other than the Python standard library. Bottle supports Python 2.7 and Python 3.

.. deprecated:: 0.13
    Support for Python 2.5 and 2.6 was dropped with this release.

User's Guide

Start here if you want to learn how to use the bottle framework for web development. If you have any questions not answered here, feel free to ask the mailing list.

.. toctree::
   :maxdepth: 2

   tutorial
   configuration
   routing
   stpl
   deployment
   api
   plugins/index

Knowledge Base

A collection of articles, guides and HOWTOs.

.. toctree::
   :maxdepth: 2

   tutorial_app
   async
   recipes
   faq

Development and Contribution

These chapters are intended for developers interested in the bottle development and release workflow.

.. toctree::
   :maxdepth: 2

   changelog
   development
   plugindev

.. toctree::
   :hidden:

   plugins/index
   contact

License

Code and documentation are available according to the MIT License:

The Bottle logo however is NOT covered by that license. It is allowed to use the logo as a link to the bottle homepage or in direct context with the unmodified library. In all other cases please ask first.

Footnotes

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