Home arrow Python arrow CherryPy: Object-Oriented Web Development

CherryPy: Object-Oriented Web Development

Python users who engage in web development may appreciate some CherryPy. It is an object-oriented web development framework that allows you to develop web applications easily. It can run on its own server, or behind Apache. Keep reading to learn more.

  1. CherryPy: Object-Oriented Web Development
  2. A Simple Script
  3. Expanding Your Application
  4. Handling User Input
By: Peyton McCullough
Rating: starstarstarstarstar / 14
January 10, 2006

print this article



Introducing CherryPy

Web development is a task for which Python isn't especially popular, but the language still presents some interesting solutions for web development. Due to Python's simple syntax and extensive standard library, I also find web development a lot easier in Python. I like object-orientation just as much as the next guy (the next guy, of course, being a Python fan), though, so an object-orientated web development framework would certain be nice. CherryPy, a pythonic, object-oriented web development framework, aims to scratch the itch of web developers like me.

CherryPy allows for easy development of web applications, whether they are small and focused or complex and broad. CherryPy runs on its own server, but it is relatively simple to run it behind Apache. Requests are mapped to objects within CherryPy applications - which are executed on their own.

Installation and Configuration

The obvious first step in installing and configuring CherryPy is to download it. It may be downloaded from its website:


CherryPy merely needs to be unzipped and then installed in the usual fashion:

python setup.py install

Now, if you choose, you can configure CherryPy to run behind Apache. This is pretty simple to do. We'll start out simple and store our CherryPy files in the directory cherrytest, and we'll configure Apache to redirect all requests to this directory straight to CherryPy. To do this, add the following lines to httpd.conf:

RewriteEngine On
RewriteRule ^/cherrytest(.*) http://localhost:8080/$1 [P]

>>> More Python Articles          >>> More By Peyton McCullough

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Python Big Data Company Gets DARPA Funding
- Python 32 Now Available
- Final Alpha for Python 3.2 is Released
- Python 3.1: String Formatting
- Python 3.1: Strings and Quotes
- Python 3.1: Programming Basics and Strings
- Tuples and Other Python Object Types
- The Dictionary Python Object Type
- String and List Python Object Types
- Introducing Python Object Types
- Mobile Programming using PyS60: Advanced UI ...
- Nested Functions in Python
- Python Parameters, Functions and Arguments
- Python Statements and Functions
- Statements and Iterators in Python

Developer Shed Affiliates


Dev Shed Tutorial Topics: