Python
  Home arrow Python arrow CherryPy: Object-Oriented Web Development
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PYTHON

CherryPy: Object-Oriented Web Development
By: Peyton McCullough
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 12
    2006-01-10


    Table of Contents:
  • CherryPy: Object-Oriented Web Development
  • A Simple Script
  • Expanding Your Application
  • Handling User Input

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    CherryPy: Object-Oriented Web Development
    ( Page 1 of 4 )

    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.

    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:

    http://cherrypy.org

    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
     

       

    PYTHON ARTICLES

    - 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
    - Sequences and Sets in Python
    - Python Expressions and Operators
    - Dictionaries, Variables and Statements in Py...
    - Data Types in Python
    - The Python Language
    - SSH with Twisted





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    Stay green...Green IT