fbpx
Wikipedia

CherryPy

CherryPy is an object-oriented web application framework using the Python programming language. It is designed for rapid development of web applications by wrapping the HTTP protocol but stays at a low level and does not offer much more than what is defined in RFC 7231.

CherryPy
Developer(s)CherryPy team
Initial releaseJune 2002; 20 years ago (2002-06)[1]
Stable release
18.8.0[2]  / 18 July 2022; 6 months ago (18 July 2022)
RepositoryCherryPy Repository
Written inPython
Operating systemCross-platform
TypeWeb application framework
LicenseBSD License[3]
Websitecherrypy.dev

CherryPy can be a web server itself or one can launch it via any WSGI 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

One of the goals of the project founder, Remi Delon, was to make CherryPy as pythonic 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 common Hello World program with CherryPy 3 would look like:

import cherrypy class HelloWorld: def index(self): return "Hello World!" index.exposed = True cherrypy.quickstart(HelloWorld()) 

Features

CherryPy implements:

  • A HTTP/1.1-compliant, WSGI thread-pooled webserver.[4] Typically, CherryPy itself takes only 1–2 ms per page.[5][6]
  • Support for any other WSGI-enabled web server or adapter, including Apache, IIS, lighttpd, mod_python, FastCGI, SCGI, and mod_wsgi.
  • A native mod_python adapter.
  • Multiple HTTP servers (e.g. ability to listen on multiple ports).[7]
  • A plugin system[8] CherryPy plugins hook into events within the server 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 for caching, encoding, sessions, authorization, static content, and others. CherryPy tools hook into events within the request 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 complete test suite for core functionality and associated framework which can be used to test CherryPy applications.[12]
  • Built-in profiling since v2.1,[13] coverage[14] and testing support.

CherryPy doesn't force you to use a specific object-relational mapper (ORM), template language or JavaScript library.

Can be used with CherryPy

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

Object-relational mappers

Templating languages

  • Mako[19] — a template library written in Python, usable with a simple CherryPy tool.[20]
  • Cheetah — an open source template 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

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

See also

References

  1. ^ "History of CherryPy".
  2. ^ "Release v18.8.0". 18 July 2022. Retrieved 18 July 2022.
  3. ^ "cherrypy / CherryPy / source / cherrypy / LICENSE.txt". BitBucket. Retrieved 21 February 2015.
  4. ^ "CherryPy — A Minimalist Python Web Framework".
  5. ^ . Archived from the original on 2016-03-03. Retrieved 2009-09-23.
  6. ^ How fast is CherryPy? 10 February 2010 at the Wayback Machine
  7. ^ . Archived from the original on 2016-03-03. Retrieved 2009-09-23.
  8. ^ Custom engine plugins with CherryPy 3 May 2009 at the Wayback Machine
  9. ^ Configuration system of CherryPy 26 June 2009 at the Wayback Machine
  10. ^ Configuration API of CherryPy 1 July 2009 at the Wayback Machine
  11. ^ Short summary of configuration options
  12. ^ How to test CherryPy itself 27 September 2009 at the Wayback Machine
  13. ^ Profiler module of CherryPy 9 February 2010 at the Wayback Machine
  14. ^ . Archived from the original on 2015-11-17. Retrieved 2009-09-23.
  15. ^ . Archived from the original on 2016-01-14. Retrieved 2009-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 ORM 22 September 2009 at the Wayback Machine
  18. ^ Dejavu 17 May 2009 at the Wayback Machine
  19. ^ Mako
  20. ^ . Archived from the original on 2016-03-03. Retrieved 2009-09-21.
  21. ^ "CherryPy – Genshi". Retrieved 2009-09-26.
  22. ^ . Archived from the original on 2012-02-27. Retrieved 2009-09-26.
  23. ^ . Archived from the original on 2015-09-05. Retrieved 2009-09-23.
  24. ^ TurboGears 1.x uses CherryPy as server and Kid as frontend 22 September 2009 at the Wayback Machine
  25. ^ CherryPy wiki about choosing a templating language 10 February 2010 at the Wayback Machine
  26. ^ . Archived from the original on 2015-11-17. Retrieved 2015-03-24.

External links

  • Official website  

cherrypy, object, oriented, application, framework, using, python, programming, language, designed, rapid, development, applications, wrapping, http, protocol, stays, level, does, offer, much, more, than, what, defined, 7231, developer, teaminitial, releasejun. CherryPy is an object oriented web application framework using the Python programming language It is designed for rapid development of web applications by wrapping the HTTP protocol but stays at a low level and does not offer much more than what is defined in RFC 7231 CherryPyDeveloper s CherryPy teamInitial releaseJune 2002 20 years ago 2002 06 1 Stable release18 8 0 2 18 July 2022 6 months ago 18 July 2022 RepositoryCherryPy RepositoryWritten inPythonOperating systemCross platformTypeWeb application frameworkLicenseBSD License 3 Websitecherrypy wbr devCherryPy can be a web server itself or one can launch it via any WSGI 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 Contents 1 Pythonic interface 2 Features 2 1 Can be used with CherryPy 2 1 1 Object relational mappers 2 1 2 Templating languages 2 2 Products using CherryPy 3 See also 4 References 5 External linksPythonic interface EditOne of the goals of the project founder Remi Delon was to make CherryPy as pythonic 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 common Hello World program with CherryPy 3 would look like import cherrypy class HelloWorld def index self return Hello World index exposed True cherrypy quickstart HelloWorld Features EditCherryPy implements A HTTP 1 1 compliant WSGI thread pooled webserver 4 Typically CherryPy itself takes only 1 2 ms per page 5 6 Support for any other WSGI enabled web server or adapter including Apache IIS lighttpd mod python FastCGI SCGI and mod wsgi A native mod python adapter Multiple HTTP servers e g ability to listen on multiple ports 7 A plugin system 8 CherryPy plugins hook into events within the server 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 for caching encoding sessions authorization static content and others CherryPy tools hook into events within the request 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 complete test suite for core functionality and associated framework which can be used to test CherryPy applications 12 Built in profiling since v2 1 13 coverage 14 and testing support CherryPy doesn t force you to use a specific object relational mapper ORM template language or JavaScript library Can be used with CherryPy Edit Routes a Python re implementation of the Ruby on Rails s routes system for mapping URLs to controllers actions and generating URLs 15 Object relational mappers Edit SQLAlchemy a database backend and ORM for Python applications TurboGears 2 x uses CherryPy as server and SQLAlchemy as its default ORM 16 SQLObject a popular ORM for providing an object interface to a database Supports a number of common database backends included in the distribution are MySQL PostgreSQL SQLite Sybase SQL Server MaxDB Microsoft SQL Server and Firebird TurboGears 1 x uses CherryPy as server and SQLObject as ORM 17 Storm the ORM from Canonical Ltd makers of Ubuntu Dejavu 18 a public domain software thread safe ORM for Python applications MongoEngine An ODM for connecting to MongoDB Templating languages Edit Mako 19 a template library written in Python usable with a simple CherryPy tool 20 Cheetah an open source template 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 Free and open source software portalComparison of web frameworksReferences Edit History of CherryPy Release v18 8 0 18 July 2022 Retrieved 18 July 2022 cherrypy CherryPy source cherrypy LICENSE txt BitBucket Retrieved 21 February 2015 CherryPy A Minimalist Python Web Framework CherryPy v3 WSGI server benchmark results Archived from the original on 2016 03 03 Retrieved 2009 09 23 How fast is CherryPy Archived 10 February 2010 at the Wayback Machine How to set up multiple HTTP servers with CherryPy Archived from the original on 2016 03 03 Retrieved 2009 09 23 Custom engine plugins with CherryPy Archived 3 May 2009 at the Wayback Machine Configuration system of CherryPy Archived 26 June 2009 at the Wayback Machine Configuration API of CherryPy Archived 1 July 2009 at the Wayback Machine Short summary of configuration options How to test CherryPy itself Archived 27 September 2009 at the Wayback Machine Profiler module of CherryPy Archived 9 February 2010 at the Wayback Machine How to collect and the analyse coverage data of application code with CherryPy Archived from the original on 2015 11 17 Retrieved 2009 09 23 A simple dispatcher tool for CherryPy that uses Routes Archived from the original on 2016 01 14 Retrieved 2009 09 27 TurboGears 2 x uses CherryPy as server and SQLAlchemy as its default ORM TurboGears 1 x uses CherryPy as server and SQLObject as ORM Archived 22 September 2009 at the Wayback Machine Dejavu Archived 17 May 2009 at the Wayback Machine Mako A simple CherryPy tool for Mako templating Archived from the original on 2016 03 03 Retrieved 2009 09 21 CherryPy Genshi Retrieved 2009 09 26 Genshi CherryPy Tools Trac Archived from the original on 2012 02 27 Retrieved 2009 09 26 A basic CherryPy Tool for using Jinja templates Archived from the original on 2015 09 05 Retrieved 2009 09 23 TurboGears 1 x uses CherryPy as server and Kid as frontend Archived 22 September 2009 at the Wayback Machine CherryPy wiki about choosing a templating language Archived 10 February 2010 at the Wayback Machine CherryPy Splunk Knowledgebase Archived from the original on 2015 11 17 Retrieved 2015 03 24 External links EditOfficial website Retrieved from https en wikipedia org w index php title CherryPy amp oldid 1106660007, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.