没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Bottle Documentation
Release 0.13-dev
Marcel Hellkamp
November 08, 2017
Contents
1 User’s Guide 3
1.1 Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Configuration (DRAFT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.3 Request Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.4 SimpleTemplate Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.5 Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
1.6 API Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
1.7 List of available Plugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2 Knowledge Base 51
2.1 Tutorial: Todo-List Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.2 Primer to Asynchronous Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
2.3 Recipes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
2.4 Frequently Asked Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3 Development and Contribution 75
3.1 Release Notes and Changelog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
3.2 Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
3.3 Developer Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
3.4 Plugin Development Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
3.5 Contact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
4 License 93
Python Module Index 95
Index 97
i
ii
Bottle Documentation, Release 0.13-dev
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.
Example: “Hello World” in a bottle
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)
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 or download bottle.py (unstable) into your project
directory. There are no hard
1
dependencies other than the Python standard library. Bottle supports Python 2.7 and
Python 3.
Deprecated since version 0.13: Support for Python 2.5 and 2.6 was dropped with this release.
1
Usage of the template or server adapter classes requires the corresponding template or server modules.
Contents 1
剩余102页未读,继续阅读
资源评论
- 麦麦冬2017-12-04全英文,看不懂
老秦丶
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功