Book Image

CherryPy Essentials: Rapid Python Web Application Development

By : Sylvain Hellegouarch
Book Image

CherryPy Essentials: Rapid Python Web Application Development

By: Sylvain Hellegouarch

Overview of this book

<p>CherryPy is a Python library for web development that allows developers to build web applications in the same way as any other object-oriented Python program. Enriched by several years of active development, it has become one of the most established toolkits for building solid and high-performance web applications in Python. CherryPy abstracts the complex low-level HTTP protocol into an easy-to-use interface that respects Python idioms. The library aims at being simple to learn for a beginner while offering the most advanced features to fluent Python developers. For these reasons CherryPy was chosen to be at the heart of the popular and feature-rich TurboGears web framework. CherryPy-powered web applications are stand-alone Python applications with their own embedded multi-threaded web server, but can also run behind Apache or IIS for scalability.</p>
Table of Contents (17 chapters)
CherryPy Essentials
Credits
About the Author
Acknowledgement
About the Reviewers
Preface
Index

Built-In HTTP Server


CherryPy comes with its own web (HTTP) server. The goal of this decision was to make CherryPy self-contained and allow users to run a CherryPy application within minutes of getting the library. As the name implies, the web server is the gateway to a CherryPy application through which all HTTP requests and responses have to go. It is therefore up to that layer to handle the low-level TCP sockets used to convey the information between the client and the server.

It is not compulsory to use the built-in server though and CherryPy is quite able to interface itself with other web servers if needed. Throughout this book, however, we will only use the default built-in web server.

To start the web server you have to make the following call:

cherrypy.server.quickstart()