Bottle (web framework)

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

Lua error in package.lua at line 80: module 'strict' not found.

Bottle
File:Bottle-logo.svg
Developer(s) Marcel Hellkamp
Initial release July 1, 2009; 15 years ago (2009-07-01)
Stable release 0.12.9 / October 24, 2015; 9 years ago (2015-10-24)[1]
Written in Python
Operating system Cross-platform
Type Web framework
License MIT
Website <strong%20class= "error"><span%20class="scribunto-error"%20id="mw-scribunto-error-2">Lua%20error%20in%20Module:Wd%20at%20line%20405:%20invalid%20escape%20sequence%20near%20'"^'. http://<strong%20class="error"><span%20class="scribunto-error"%20id="mw-scribunto-error-2">Lua%20error%20in%20Module:Wd%20at%20line%20405:%20invalid%20escape%20sequence%20near%20'"^'.Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).

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.[2]

It offers request dispatching (routes) with URL parameter support, templates, key-value database, a built-in web server and adapters for many third-party WSGI/HTTP-server and template engines.[3]

It is designed to be lightweight, and to allow development of web applications easily and quickly.[4]

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[5]

Example

A simple "Hello World!"

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)

References

<templatestyles src="Reflist/styles.css" />

Cite error: Invalid <references> tag; parameter "group" is allowed only.

Use <references />, or <references group="..." />

External links

  1. https://github.com/bottlepy/bottle/releases
  2. Bottle website
  3. Web Frameworks for Python
  4. Digital Ocean Bottle tutorial
  5. List of available Plugins