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
blog comments powered by Disqus |