What is Bottle?
Bottle is a WSGI micro web-framework for the Python programming language. It is designed to be fast, simple and lightweight, and is distributed as a single file module with no dependencies other than the Python Standard Library. The same module runs with Python 2.5+ and 3.x.
It offers request dispatching (routes) with URL parameter support, templates, a built-in web server and adapters for many third-party WSGI/HTTP-server and template engines.
It is designed to be lightweight, and to allow development of web applications easily and quickly.
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.
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, jinja2 and cheetah 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, fapws3, bjoern, gae, cherrypy or any other WSGI capable HTTP server.
Features
- Single file which runs with both Python 2.5+ and 3.x
- Can run as a standalone web server or be used behind ("mounted on") any web server which supports WSGI
- Built-in template engine called SimpleTemplate Engine
- Support for JSON client data (for REST and JavaScript clients)
- Plugins for popular databases and key/value stores and other features
Example Code
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)
Video for Bottle
https://www.youtube.com/watch?v=g_9nsFJS_pk