Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

CherryPy

From Wikipedia, the free encyclopedia
Web application framework
CherryPy
Developer(s)CherryPy team
Initial releaseJune 2002; 22 years ago (2002-06)[1]
Stable release
18.10.0[2] Edit this on Wikidata / 15 June 2024; 9 months ago (15 June 2024)
RepositoryCherryPy Repository
Written inPython
Operating systemCross-platform
TypeWeb application framework
LicenseBSD License[3]
Websitecherrypy.dev
This articlemay contain excessive or inappropriate references toself-published sources. Please helpimprove it by removing references to unreliablesources where they are used inappropriately.(April 2024) (Learn how and when to remove this message)

CherryPy is anobject-orientedweb application framework using thePython programming language. It is designed forrapid development ofweb applications bywrapping theHTTP protocol but stays at a low level and does not offer much more than what is defined in RFC 7231.

CherryPy can be a web server itself or one can launch it via anyWSGI compatible environment. It does not deal with tasks such as templating for output rendering or backend access. The framework is extensible with filters, which are called at defined points in the request/response processing.

Pythonic interface

[edit]

One of the goals of the project founder,Remi Delon, was to make CherryPy aspythonic as possible. This allows the developer to use the framework as any regular Python module and to forget (from a technical point of view) that the application is for the web.

For instance, the commonHello World program with CherryPy 3 would look like:

importcherrypyclassHelloWorld:defindex(self):return"Hello World!"index.exposed=Truecherrypy.quickstart(HelloWorld())

Features

[edit]

CherryPy implements:

  • AHTTP/1.1-compliant,WSGIthread-pooled webserver.[4] Typically, CherryPy itself takes only 1–2 ms per page.[5][6]
  • Support for any other WSGI-enabledweb server or adapter, includingApache,IIS,lighttpd,mod_python,FastCGI,SCGI, andmod_wsgi.
  • A nativemod_python adapter.
  • Multiple HTTP servers (e.g. ability to listen on multiple ports).[7]
  • Aplugin system[8] CherryPyplugins hook into events within theserver process — into server startup, server shutdown, server exiting, etc. — to run code that needs to be run when the server starts up or shuts down.
  • Built-in tools forcaching,encoding,sessions,authorization, static content, and others. CherryPytools hook into events within therequest process. Whenever the CherryPy server receives a request, there is a specific set of steps it goes through to handle that request. Page handlers are only one step in the process. Tools also provide a syntax and configuration API for turning them on and off for a specific set of handlers.
  • A configuration system for developers and deployers .[9][10][11] CherryPy deployments are configurable on site, on application and on controller level, through Python dictionaries, configuration files, and open file objects.
  • A completetest suite for core functionality and associated framework which can be used to test CherryPy applications.[12]
  • Built-inprofiling since v2.1,[13]coverage[14] and testing support.

CherryPy doesn't force you to use a specificobject-relational mapper (ORM),template language orJavaScript library.

Can be used with CherryPy

[edit]
  • Routes — a Python re-implementation of theRuby on Rails's routes system for mappingURLs to controllers/actions and generating URLs.[15]

Object-relational mappers

[edit]

Templating languages

[edit]
  • Mako[19] — a template library written in Python, usable with a simple CherryPy tool.[20]
  • Cheetah — an open sourcetemplate engine and code generation tool, written in Python.
  • CherryTemplate — a templating language for CherryPy.
  • Genshi[21][22] — a powerful XML templating language.
  • Jinja — a general purpose templating language. CherryPy has a tool for using Jinja templates.[23]
  • Kid — a simple template language for XML based vocabularies written in Python.TurboGears 1.x uses CherryPy as server and Kid as frontend.[24]

CherryPy wiki helps[25] choosing a templating language.

Products using CherryPy

[edit]
  • TurboGears — CherryPy 2.x is a main component of TurboGears 1.x.
  • Splunk Enterprise - CherryPy 3.1.2[26]

See also

[edit]

References

[edit]
  1. ^"History of CherryPy".
  2. ^"Release v18.10.0". 15 June 2024. Retrieved2 February 2025.
  3. ^"cherrypy / CherryPy / source / cherrypy / LICENSE.txt". BitBucket. Archived fromthe original on 15 July 2017. Retrieved21 February 2015.
  4. ^"CherryPy — A Minimalist Python Web Framework".
  5. ^"CherryPy v3 WSGI server benchmark results". Archived fromthe original on 2016-03-03. Retrieved2009-09-23.
  6. ^How fast is CherryPy?Archived 10 February 2010 at theWayback Machine
  7. ^"How to set up multiple HTTP servers with CherryPy". Archived fromthe original on 2016-03-03. Retrieved2009-09-23.
  8. ^Custom engine plugins with CherryPyArchived 3 May 2009 at theWayback Machine
  9. ^Configuration system of CherryPyArchived 26 June 2009 at theWayback Machine
  10. ^Configuration API of CherryPyArchived 1 July 2009 at theWayback Machine
  11. ^Short summary of configuration options
  12. ^How to test CherryPy itselfArchived 27 September 2009 at theWayback Machine
  13. ^Profiler module of CherryPyArchived 9 February 2010 at theWayback Machine
  14. ^"How to collect and the analyse coverage data of application code with CherryPy". Archived fromthe original on 2015-11-17. Retrieved2009-09-23.
  15. ^"A simple dispatcher tool for CherryPy that uses Routes". Archived fromthe original on 2016-01-14. Retrieved2009-09-27.
  16. ^TurboGears 2.x uses CherryPy as server and SQLAlchemy as its default ORM
  17. ^TurboGears 1.x uses CherryPy as server and SQLObject as ORMArchived 22 September 2009 at theWayback Machine
  18. ^DejavuArchived 17 May 2009 at theWayback Machine
  19. ^Mako
  20. ^"A simple CherryPy tool for Mako templating". Archived fromthe original on 2016-03-03. Retrieved2009-09-21.
  21. ^"CherryPy – Genshi". Retrieved2009-09-26.
  22. ^"Genshi - CherryPy Tools - Trac". Archived fromthe original on 2012-02-27. Retrieved2009-09-26.
  23. ^"A basic CherryPy Tool for using Jinja templates". Archived fromthe original on 2015-09-05. Retrieved2009-09-23.
  24. ^TurboGears 1.x uses CherryPy as server and Kid as frontendArchived 22 September 2009 at theWayback Machine
  25. ^CherryPy wiki about choosing a templating languageArchived 10 February 2010 at theWayback Machine
  26. ^"CherryPy - Splunk Knowledgebase". Archived fromthe original on 2015-11-17. Retrieved2015-03-24.

External links

[edit]
.NET
C++
ColdFusion
Common Lisp
Haskell
Java
JavaScript
Perl
PHP
Python
Ruby
Rust
Scala
Smalltalk
Other languages
Retrieved from "https://en.wikipedia.org/w/index.php?title=CherryPy&oldid=1252136002"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp