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.

Features of Bottle:

  1. Routing: Requests to function-call mapping with support for clean and dynamic URLs.
  2. Templates: Fast and pythonic built-in template engine and support for mako, jinja2 and cheetah templates.
  3. Utilities: Convenient access to form data, file uploads, cookies, headers and other HTTP-related metadata.
  4. Server: Built-in HTTP development server and support for paste, fapws3, bjoern, gae, cherrypy or any other WSGI capable HTTP server.

A simple Bottle example


import sqlite3
from bottle import route, run

@route('/todo')
def todo_list():
    conn = sqlite3.connect('todo.db')
    c = conn.cursor()
    c.execute("SELECT id, task FROM todo WHERE status LIKE '1'")
    result = c.fetchall()
    return str(result)

run()

Craig Derington

Veteran full stack web dev focused on deploying high-performance, modern applications using Python, Go and Node; featuring industry leading frameworks, Django & Flask, and backends MySQL and MongoDB.

comments powered by Disqus