编辑“︁
CherryPy
”︁(章节)
跳转到导航
跳转到搜索
警告:
您没有登录。如果您进行任何编辑,您的IP地址会公开展示。如果您
登录
或
创建账号
,您的编辑会以您的用户名署名,此外还有其他益处。
反垃圾检查。
不要
加入这个!
==特征== CherryPy实现了: * 遵循[[HTTP]]/1.1、[[Web服务器网关接口|WSGI]]的[[线程池]]的webserver<ref>{{Cite web |url=http://www.cherrypy.org/#Features |title=存档副本 |access-date=2021-03-12 |archive-date=2021-05-14 |archive-url=https://web.archive.org/web/20210514234054/https://cherrypy.org/#Features }}</ref>。典型的,CherryPy自身每页只用1–2ms<ref>{{Cite web |url=http://www.aminus.org/blogs/index.php/2006/12/23/cherrypy_3_has_fastest_wsgi_server_yet |title=CherryPy v3 WSGI server benchmark results |access-date=2009-09-23 |archive-url=https://web.archive.org/web/20160303200606/http://www.aminus.org/blogs/index.php/2006/12/23/cherrypy_3_has_fastest_wsgi_server_yet |archive-date=2016-03-03 }}</ref><ref>[http://www.cherrypy.org/wiki/CherryPySpeed How fast is CherryPy?] {{webarchive |url=https://web.archive.org/web/20100210133216/http://www.cherrypy.org/wiki/CherryPySpeed |date=2010-02-10 }}</ref>。 * 支持任何任何其他启用WSGI的[[web服务器]]或适配器,包括[[Apache HTTP Server|Apache]]、[[互联网信息服务|IIS]]、[[lighttpd]]、{{le|mod_python}}、[[FastCGI]]、[[SCGI]]和{{le|mod_wsgi}}。 * 一个原生的{{le|mod_python}}适配器。 * 多个HTTP服务器(就是有能力监听多个端口)<ref>{{Cite web |url=http://tools.cherrypy.org/wiki/MultipleHttpServers |title=How to set up multiple HTTP servers with CherryPy |access-date=2009-09-23 |archive-url=https://web.archive.org/web/20160303175022/http://tools.cherrypy.org/wiki/MultipleHttpServers |archive-date=2016-03-03 }}</ref>。 * 一个[[插件]]系统<ref>[http://www.cherrypy.org/wiki/CustomPlugins Custom engine plugins with CherryPy] {{webarchive |url=https://web.archive.org/web/20090503091300/http://www.cherrypy.org/wiki/CustomPlugins |date=2009-05-03 }}</ref>,CherryPy插件挂钩到在服务器进程内的事件,服务器启动、服务器关闭、服务器退出等,用来执行在服务器启动和关闭时需要运行的代码。 * 内建工具用于[[web缓存|缓存]]、[[字符编码|编码]]、[[会话 (计算机科学)|会话]]、[[授權 (資安)|授权]]、静态内容和其他。CherryPy工具挂钩到在请求处理内的事件。在CherryPy服务器收到一个请求的时候,它有一组特定的步骤要履行来处理这个请求。页面处理器只是这个处理的步骤之一。工具还提供语法和配置API来为特定集合的处理器而打开和关闭它们。 * 给开发者和部署者的一个配置系统<ref>[http://www.cherrypy.org/chrome/common/2.2/docs/book/chunk/ch03.html#id3467720 Configuration system of CherryPy] {{webarchive |url=https://web.archive.org/web/20090626050839/http://www.cherrypy.org/chrome/common/2.2/docs/book/chunk/ch03.html#id3467720 |date=2009-06-26 }}</ref><ref>[http://www.cherrypy.org/wiki/ConfigAPI Configuration API of CherryPy] {{webarchive |url=https://web.archive.org/web/20090701025825/http://www.cherrypy.org/wiki/ConfigAPI |date=2009-07-01 }}</ref><ref>{{Cite web |url=http://docs.turbogears.org/1.0/Configuration#id5 |title=Short summary of configuration options |access-date=2021-03-12 |archive-date=2010-08-18 |archive-url=https://web.archive.org/web/20100818231635/http://docs.turbogears.org/1.0/Configuration#id5 }}</ref>。CherryPy部署可配置于站点上、应用上和在控制器层面上,通过Python字典、配置文件和打开文件对象。 * 一个完全的[[测试套件]]用于核心功能和有关框架,可以用来测试CherryPy应用<ref>[http://www.cherrypy.org/wiki/Testing How to test CherryPy itself] {{webarchive |url=https://web.archive.org/web/20090927033305/http://www.cherrypy.org/wiki/Testing |date=2009-09-27 }}</ref>。 * 内建[[性能分析|剖析]]自从v2.1<ref>[http://www.cherrypy.org/wiki/WhatsNewIn21#NewProfilermodule Profiler module of CherryPy] {{webarchive |url=https://web.archive.org/web/20100209001310/http://www.cherrypy.org/wiki/WhatsNewIn21#NewProfilermodule |date=2010-02-09 }}</ref>、[[代码覆盖|覆盖]]<ref>{{Cite web |url=http://www.aminus.org/blogs/index.php/2005/08/19/code_coverage_with_cherrypy_2_1?blog=2 |title=How to collect and the analyse coverage data of application code with CherryPy |access-date=2009-09-23 |archive-url=https://web.archive.org/web/20151117025544/http://www.aminus.org/blogs/index.php/2005/08/19/code_coverage_with_cherrypy_2_1?blog=2 |archive-date=2015-11-17 }}</ref>和测试支持。 CherryPy不强制使用特定[[对象关系映射器]](ORM)、{{le|Web模板系统|Web template system|模板语言}}或[[JavaScript库]]。 ===可用于CherryPy的模块=== * Routes,一个[[Ruby on Rails]]的路由系统的Python重新实现,用于映射[[URL]]到控制器/行动和生成URL<ref>{{Cite web |url=https://routes.readthedocs.io/en/latest/ |title=Routes Documentation |access-date=2021-03-13 |archive-date=2019-11-28 |archive-url=https://web.archive.org/web/20191128201941/https://routes.readthedocs.io/en/latest/ }}</ref>。 ====对象关系映射器==== * [[SQLAlchemy]],用于Python应用的一个数据库后端和[[对象关系映射|ORM]]。 * [[SQLObject]],一个流行的[[对象关系映射|ORM]]用于提供到数据库的对象接口。支持很多常见数据库后端:包括在发行中的有[[MySQL]]、[[PostgreSQL]]、[[SQLite]]、[[Sybase SQL Server]]、[[MaxDB]]、[[Microsoft SQL Server]]和[[Firebird (数据库)|Firebird]]。 * {{le|Storm (软件)|Storm (software)|Storm}},[[Canonical]]公司的[[对象关系映射|ORM]]。 * MongoEngine,用于连接到[[MongoDB]]的[[对象关系映射|ODM]]<ref>{{cite web |url=http://mongoengine.org/ |title=mongoengine.org |access-date=2021-03-13 |archive-date=2021-01-17 |archive-url=https://web.archive.org/web/20210117144122/http://mongoengine.org/ }}</ref>。 ====模板语言==== * Mako<ref>{{Cite web |url=https://www.makotemplates.org/ |title=Mako Templates for Python |access-date=2021-03-12 |archive-date=2021-05-11 |archive-url=https://web.archive.org/web/20210511153743/https://www.makotemplates.org/ }}</ref>,用Python写的模板库,可用于简单的CherryPy工具<ref>{{Cite web |url=http://tools.cherrypy.org/wiki/Mako |title=A simple CherryPy tool for Mako templating |access-date=2009-09-21 |archive-url=https://web.archive.org/web/20160303201627/http://tools.cherrypy.org/wiki/Mako |archive-date=2016-03-03 }}</ref>。 * {{le|CheetahTemplate||Cheetah}},开源{{le|Web模板系统|Web template system|模板引擎}}和代码生成工具,用Python写成。 * CherryTemplate,CherryPy的模板语言。 * {{le|Genshi (模板语言)|Genshi (templating language)|Genshi}}<ref>{{cite web|url=http://genshi.edgewall.org/wiki/CherryPy|title=CherryPy – Genshi|access-date=2009-09-26|archive-date=2012-07-04|archive-url=https://www.webcitation.org/68trwhFFO?url=http://genshi.edgewall.org/wiki/CherryPy}}</ref><ref>{{cite web|url=http://tools.cherrypy.org/wiki/Genshi|title=Genshi - CherryPy Tools - Trac|access-date=2009-09-26|archive-url=https://web.archive.org/web/20120227062117/http://tools.cherrypy.org/wiki/Genshi|archive-date=2012-02-27}}</ref>,强力的XML模板引擎。 * [[Jinja2|Jinja]],通用模板语言。CherryPy拥有使用Jinja模板的一个工具<ref>{{Cite web |url=http://tools.cherrypy.org/wiki/Jinja |title=A basic CherryPy Tool for using Jinja templates |access-date=2009-09-23 |archive-url=https://web.archive.org/web/20150905175257/http://tools.cherrypy.org/wiki/Jinja |archive-date=2015-09-05}}</ref>。 * {{le|Kid (模板语言)|Kid (templating language)|Kid}},一个简单的模板语言,用于基于XML的用Python写的词汇表。
摘要:
请注意,所有对Local Chinese Wikipedia的贡献均可能会被其他贡献者编辑、修改或删除。如果您不希望您的文字作品被随意编辑,请不要在此提交。
您同时也向我们承诺,您提交的内容为您自己所创作,或是复制自公共领域或类似自由来源(详情请见
Project:著作权
)。
未经许可,请勿提交受著作权保护的作品!
取消
编辑帮助
(在新窗口中打开)
导航菜单
个人工具
未登录
讨论
贡献
创建账号
登录
命名空间
页面
讨论
大陆简体
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
臺灣正體
查看
阅读
编辑
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息