Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here

bottle is a fast and simple micro-framework for python web-applications.

Subscribe to updates I use bottle

Statistics on bottle

Number of watchers on Github 5271
Number of open issues 248
Average time to close an issue 14 days
Main language Python
Average time to merge a PR 12 days
Open pull requests 78+
Closed pull requests 32+
Last commit almost 2 years ago
Repo Created over 10 years ago
Repo Last Updated over 1 year ago
Size 5.71 MB
Organization / Authorbottlepy
Page Updated
Do you use bottle? Leave a review!
View open issues (248)
View bottle activity
View on github
Fresh, new opensource launches πŸš€πŸš€πŸš€
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating bottle for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

.. image:: :target: :alt: Bottle Logo :align: right

.. image:: :target: :alt: Bottle Build

.. image:: :target: :alt: CI Bottle

.. image:: :target: :alt: Coverage

.. image:: :target: :alt: Latest Version

.. image:: :target: :alt: License

.. _mako: .. _cheetah: .. _jinja2: .. _paste: .. _fapws3: .. _bjoern: .. _cherrypy: .. _WSGI: .. _Python:


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 <>_.

  • 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_, Google App Engine <>, cherrypy or any other WSGI_ capable HTTP server.

Homepage and documentation:

Example: Hello World in a bottle

.. code-block:: python

from bottle import route, run, template

@route('/hello/') def index(name): return template('Hello {{name}}!', 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, easy_install -U bottle or download bottle.py__ (unstable) into your project directory. There are no hard dependencies other than the Python standard library. Bottle runs with Python 2.7 and 3.3+.


.. __:

Code and documentation are available according to the MIT License (see 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.

bottle open issues Ask a question     (View All Issues)
  • about 3 years Fetching _body multiple times in POST request fails second time.
  • about 3 years Deserialization security issues when using signed cookies
  • about 3 years different behavior using the server meinheld
  • about 3 years Add support for custom tplid for template caching
  • over 3 years the autojson can't correctly handle chinese
  • over 3 years include() should honour current indentation level for all lines
  • over 3 years bottle 0.12.9 PyPI package: touni doesn't contain None to empty string fix
  • over 3 years new plugin: canister (provides logs, sessions, oauth2 support...)
  • over 3 years FileUpload.filename cut off multi-byte characters (only extension is left)
  • over 3 years Add support for TLS
  • over 3 years Bottle app running on Paste or CherryPy or any other server cannot handle chunked input
  • over 3 years Not Support Expect:100-continue (HTTP/1.1)
  • over 3 years Order of operations for route filters and route selection not documented
  • almost 4 years Fail to retrieve Content-Length from the HTTP response header
  • almost 4 years Python 3.4.3 & Bottle with CGI - environ['REQUEST_METHOD'] issue
  • almost 4 years Unable to set charset property (as presented in the official tutorial)
  • almost 4 years Bottle and Interactive shell
  • almost 4 years redirecting in befoe_request hook is not working as before
  • almost 4 years ResourceWarning unclosed <socket.socket>
  • about 4 years set_cookie inside a plugin for mounted applications
  • about 4 years parent death signal with reloader=True
  • about 4 years adding new features?
  • about 4 years Unable to mount to path containing variable
  • about 4 years redirect() and non-ascii characters
  • about 4 years test_delete_cookie fails with Python 3.5
  • about 4 years Why is bottle not listed in github explore list for web frameworks.
  • about 4 years Add pathlib support to static_file
  • over 4 years Add a way to get nested dicts out of a ConfigDict for libraries that need them (e.g. logging.config, beaker)
  • over 4 years Formsdict attribute like access returns invalid values for parameters submitted with unicode characters
  • over 4 years Allow passing options to eventlet server
bottle open pull requests (View All Pulls)
  • Fix typo in doc code snippet
  • WaitressServer: pass self.options to serve method
  • Request.msgpack property
  • Add test case for 'load_config'
  • all_errors wrapper
  • Redirect bugfix
  • Allow for long result codes
  • Add "startup" hook that is called on run()
  • Added certfile option to WSGIRefServer to specify SSL
  • Add SSL/TLS support to TwistedServer
  • fixes issue #671
  • fix typo in the Route class docstring
  • Remove unused parameter from the "depr" function.
  • Updated docs
  • Tidied version of #566
  • Support multiple character encodings in HTTP header
  • Update CherryPy SSL to use latest API and work on Py3
  • PEP8 Compliant Code
  • Make `root='/'` work cross-platform
  • Fix the Allow: header value in 405 "Method not allowed." response.
  • Fix 602 unicode path encoding when mounting application.
  • FileCheckerThread: thread.interrupt_main -> sys.exit
  • Support Reloading with Eventlet
  • issue 585 reopen
  • Allow custom bind_addr for CherryPy
  • Multi-phase run for WSGIRefServer
  • Fixed path being unshifted before returned generator exhausted.
  • lookup callable: allows e.g. <template>/de.tpl or modify
  • Route ordering similar to werkzeug
  • zindex in router to control route matching order
  • Update changelog.rst indentation
  • Inherit template's syntax while rendering sub-templates
  • fix invalid badge links
  • Adding circuits.web Server support
  • mount with segmented prefix
  • Minor code fixes and pep8 rules applied
  • make it possible to provide a logger for gevent (before, the logger would be replaced by 'default')
  • New doc section about adding authentication, and 2 small fixes
  • Jinja2Template: Pass filename to Jinja2
  • Add support for flipflop fastCGI connector
  • port bottle cli optparse to argparse where possible
  • Clean python 2.6
  • Add Support for UVLoop and custom asyncio loop option
  • Add WSGIserver support
  • Update docs/tutorial_app.rst
  • Added support for arrays in POST requests
  • Append custom headers to reponse
  • template export it's namespace to subtemplate
  • Allow for zero-copy file uploads.
  • Fix: PATH_INFO always contains "/" for mounted app root
  • Add ShpamlTemplate class (& shpaml_template/shpaml_view helpers).
  • Add a template mechanism for EZT templates.
  • Static file multithreading
  • Don't want to work under virtualenv
  • Adding the case where a closure not more contains a function in the recursion
  • that should fix #922
  • Added to new Plugins
  • Receiving a code other than 2xx generate exception
  • a slightly tweaked version of @defnull's warning suggestion in #961
  • MAX_BODY_SIZE support in tornado and meinheld
  • It's 2017....
  • Support ujson
  • fix links commits #925
  • bugfix: support multiple proxies ('HOSTNAME, HOSTNAME2' syntax)
  • conn > con in tutorial app
  • Update tutorial_app.rst
  • Updated documentation on SimpleTemplate and embedded blocks.
  • Added bottle-oauthlib project reference
  • replace traceback with cgitb for error handling
  • Add UnicodeFormsPlugin + tests
  • Explicitly add global variables to the globals dictionary passed to exec statement when executing compiled templates.
  • from bottle import touni
  • Fixed ResourceWarning: unclosed file <_io.BufferedReader... in static…
  • Fix path_shift fall back always triggering
  • Fix for #1048 - Added header options support to set_header()
  • Fix resources leak in tests
  • Fix deprecation warning for imp module
  • Add peewee-session project reference
bottle questions on Stackoverflow (View All Questions)
  • How do I use python Bottle and Gunicorn with custom settings ini file?
  • How to get full duplex websocket with Bottle and MQTT
  • Implementing Simple CAPTCHA in Bottle
  • ImportError: No module named 'bottle' - PyCharm
  • How to work with text files in Python Bottle
  • bottle request.forms.get returns None
  • How to get client IP address using python bottle framework
  • How do, WAMP, twisted (+ klein), and django/flask/bottle interact?
  • Python Return a list in Bottle
  • Inserting a folder containing specific routes to a bottle application in Python
  • Deploying Python bottle app with pymssql on heroku
  • Python Bottle Website Automate Tasks
  • Python: Retrieve the Mac Address of the client using bottle framework
  • Python Bottle website visible over network?
  • bottle template: how to import a python package
  • window.location.href with dynamic parameter is not working with bottle webframework
  • Custom plugin with Bottle to return datetime as JSON?
  • Chrome Error code: ERR_UNSAFE_PORT - Bottle hello world app not showing in browser
  • Why is self superfluous for a method when using bottle in a class?
  • Unhandled exception (http error 500) when using Bottle with AJAX
  • How to filter IP addresses by route in bottle?
  • Python: Retrieve the current URL from the browser using bottle framework
  • Get Headers/Cookies from Bottle API request
  • 'Address already in use' error in bottle Python Web Framework with paste server library
  • Sending a file via http in Python with bottle framework
  • python bottle authentication by hook & beaker
  • How to gzip response while using Bottle with Cherrypy?
  • Import Javascript file in Bottle (framework jQuery)
  • Bottle Python Error 404: Not found: '/'
  • How to construct bottle large application
bottle list of languages used
More projects by bottlepy View all
Other projects in Python