bottle

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

Github星跟踪图

.. image:: http://bottlepy.org/docs/dev/_static/logo_nav.png
:target: http://bottlepy.org/
:alt: Bottle Logo
:align: right

.. image:: https://github.com/bottlepy/bottle/workflows/Tests/badge.svg
:target: https://github.com/bottlepy/bottle/workflows/Tests
:alt: Tests Status

.. image:: https://img.shields.io/pypi/v/bottle.svg
:target: https://pypi.python.org/pypi/bottle/
:alt: Latest Version

.. image:: https://img.shields.io/pypi/l/bottle.svg
:target: https://pypi.python.org/pypi/bottle/
:alt: License

.. _mako: http://www.makotemplates.org/
.. _cheetah: http://www.cheetahtemplate.org/
.. _jinja2: http://jinja.pocoo.org/
.. _paste: http://pythonpaste.org/
.. _fapws3: https://github.com/william-os4y/fapws3
.. _bjoern: https://github.com/jonashaag/bjoern
.. _cherrypy: http://www.cherrypy.org/
.. _WSGI: http://www.wsgi.org/
.. _Python: http://python.org/

============================
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 <http://docs.python.org/library/>_.

  • Routing: Requests to function-call mapping with support for clean and dynamic URLs.
  • Templates: Fast and pythonic *built-in template engine* <http://bottlepy.org/docs/dev/tutorial.html#tutorial-templates>_ 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 <https://cloud.google.com/appengine/>, cherrypy or any other WSGI_ capable HTTP server.

Homepage and documentation: http://bottlepy.org

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

.. __: https://github.com/bottlepy/bottle/raw/master/bottle.py

Install the latest stable release with pip install 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.4+.

License

.. __: https://github.com/bottlepy/bottle/raw/master/LICENSE

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.

主要指标

概览
名称与所有者bottlepy/bottle
主编程语言Python
编程语言Makefile (语言数: 4)
平台
许可证MIT License
所有者活动
创建于2009-06-30 17:51:30
推送于2025-04-21 15:32:29
最后一次提交2025-04-21 18:32:29
发布数86
最新版本名称0.13.3 (发布于 2025-04-21 13:47:52)
第一版名称0.4.10 (发布于 2009-07-10 22:07:52)
用户参与
星数8.6k
关注者数305
派生数1.5k
提交数2k
已启用问题?
问题数850
打开的问题数217
拉请求数341
打开的拉请求数65
关闭的拉请求数211
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?