CherryPy Overview
I spent a lot of the weekend looking into the Cherrypy framework. At first I found it very confusing. I was looking at it from a PHP and MVC framework perspective and could not exactly grasp why it is so popular and great as it claims to be!
Only after looking at the API and thinking about the first two lines on their home page, I realised what Cherrypy is exactly about.
From the home page:
CherryPy is a pythonic, object-oriented HTTP framework.
CherryPy
allows developers to build web applications in much the same way they
would build any other object-oriented Python program. This usually
results in smaller source code developed in less time.
You have to remember that PHP is a web development language. That was what PHP was developed for. Although you can manipulate the server and run commandline commands with PHP, it was not meant for that. Python on the other hand is exactly the opposite. It was meant to be a scripting language to manipulate the server and not exclusively meant for the internet. Python do have some great support for building web applications, but unlike PHP was not written exclusively for that.
So what is Cherrypy built for? Simple. It allows you to easily take your Python code and publish it to the web. You could do it without Cherrypy, sure! Using Python and CGI you can write kick-ass Python web applications. (Or mod_python if you use Apache) You will however need to know a bit of the HTTP protocol to do that. However, if you use Cherrypy, you don’t need to worry about any of the daunting HTTP protocol. Cherrypy will handle all that for you. All you need to do is write your kick-ass software!
Cherrypy is NOT a MVC (Model-View-Controller) Framework! That was the mistake I made when looking into Cherrypy. The MVC part of your application you will have to design and develop yourself. Python does make it easy for you, due to its Object Orientated nature!
That being said, Cherrypy does have a set of good tools. For example, it has tools to easily and without effort build in session management, build XMLRPC functions and a couple more!
technorati tags:cherrypy, http, webdevelopment, python
Blogged with Flock
5 Comments to "CherryPy Overview"
Spit it out!
Kick-ass Tools, Python, web development Stii
Recent Posts
- Afrigator vs Regator
- Don’t pirate music/movies! You might be forced to use Windows if you do…
- Pike > Python?
- Using Twhirl for FriendFeed
- Being anti-social SUCKS!
- Example using XFN and Optimus to find friends on Afrigator
- Optimus, the ultimate Microformats parser
- Please support UnitedForAfrica.co.za
- Afrigator Beta2.0 - Lets amplify the Xenophobia issue
- What can we as bloggers do about the Xenophobia crisis?
My Posse
- Jayx’s bloggy
- Gogo’s blog
- Go2 South Africa
- Stumble Upon
- Dave Duarte
- Wikipedia
- zlythern
- Max Kaizen
- Tresblue
- Mike Stopforth
- RafiQ
- Muti.co.za
- Employmint
- Danette’s Bloggy!
- Thinking Machine
- White African
- kiefpiet.co.za
- Skuff’s World
- Goozeberry
- Crossloop blog
- Crossloop
- Aquila Online
- Charl van Niekerk
- Derek Allard
- Code Igniter
- Carls
- Justin Hartman
- blik.co.za
- Stefano Sessa
- Uno de Waal
- Amplitude!
- bLaugh
- Tyler Reed
- Chris Rawlinson
- Stormhoek!
- 3am
- Mike Solomon
- Mobile Q and A
- Eric Edelstein
- Marc Forrest
- Imel Rautenbach
- Absolutewillie
- Vincent Maher
- Colin Daniels
- Groogle!
- Chilibean
- Paul Jacobson
- Ayelet
- Python Guru Neil
- Rails Guru Nic
- Beverley Merriman
- Miguel
- Nic Harrywhatshisname
- Chris iMod
- Geekrebel!
- Steven McD
- Belinda sweetheart!
- Henre Rossouw
- JPGeek
- Foxinni
- Adii
- Charl Norman
- Bandwidthblog
- Jason Bagley
- Simon Botes
- Auric Silverwing
- Mark Forrester
- Saul Kropman
- Fred Roed
- Sass Schultz
Filed in
- Afrigator (26)
- ajax (9)
- API (2)
- Apple stuff (10)
- Blogging (24)
- browsers (5)
- Business (27)
- Code Igniter (8)
- firefox (8)
- flock (14)
- Funnies (72)
- GeekDinner! (18)
- General and sometimes Rants (47)
- Go2SA (2)
- ideas 2.0 (14)
- javascript (12)
- Kick-ass Tools (30)
- Linux (5)
- Marketing (25)
- moo.ajax (4)
- mootools (6)
- Open Source (10)
- Programming (33)
- C# (1)
- PHP (13)
- Python (9)
- Ruby (on Rails) (9)
- RSS (5)
- Semantic Web (32)
- Social Web (57)
- Software Development (15)
- South Africa (33)
- Tagging (6)
- Techie stuff (22)
- Tshirts (2)
- Tutorials (42)
- Blogging (17)
- Flocking (6)
- muti.co.za (13)
- Web 2.0 (73)
- web development (20)
Past Stuff
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006

















Thanks for the interesting info. Although there are lots of local companies offering PHP and even some offering Ruby on Rails hosting, how many are there offering Python hosting? Do you know of any specifically you could recommend?
I know that at organisations like the W3C and the WHATWG, PHP is often looked at negatively since it’s meant for hacks, not for proper OO-development. Personally I feel in PHP 5 you can write some really structured and neat stuff. I don’t really know what makes Python so much better fundamentally, but it looks really cool anyway. I hacked on it a bit for Pootle last year and that really pwned.
Hey Charl, according to some very interesting benchmark tests that have been done, Python came out tops for performance. I’ll look if I can find the results again and post them. Python is also a very language!
As far as I know, there is not much options for Python hosting in South Africa, but there is plenty abroad.
Oh and there is one fundamental diference between Python and PHP in that Python is pure OO while PHP is not. Even in PHP 5 I don’t think it is as pure OO as Python is. I might be wrong, since I have not looked at PHP 5 that much yet. In Python EVERYTHING is an object. In my books that is a major plus point as far as OO techniques go in any language.
Don’t get me wrong though, I am and will be for a long time still to come a PHP fan. At least until someone develop Code Igniter in Python!
Even if the hosting itself is abroad, that is fine, since local hosting packages really suck anyway. I just want local South African companies to offer the hosting since overseas payments suck.
Python would be like Java then - really tightly OO. That is a good thing. I find that you can do either really clean and structured OO-based coding in PHP or really messy coding, whichever you prefer. Java tries to take away the opportunities for generating messy code, but I think that even given the most strict and perfect language an idiot will always be able to stuff it up badly.
PHP 5 offers nice features such as deconstructors and exceptions. I have to say that a lack of those two is really irritating. Autoloading is also quite cool. There are some ways to implement deconstructors in PHP 4 but it remains yet another hack. However I really don’t see how anybody manages to code without exceptions these days - that just makes life sooo much easier.
That is a great overview Stii.
Charl for your info, when I started looking for hosting companies for muti I really wanted to use a South African hosting company but I could not find any that supported Python. In fact the few that I spoke to had barely heard of Python, everything was PHP based. Regarding you observation Charl, that Python would be like Java, I would have to differ with you there. Java is very strictly typed while Python is very loosely typed. Also not everything is an object in Java. (e.g. ints and longs are not object while Ints and Longs (uppercase) are objects, although admittedly auto-boxing in Java 5 blurs the distinction a bit)
Hi Neville, thanks for the info. I actually didn’t mean that Python is like Java in all respects, just that it’s been designed with OO in mind from the group up. Although Java was one of the first languages that really forced people to use classes (even when they’re not using OOP) this is typical of most modern languages including C# etc.
Strictly speaking in Python you can still have modules so you’re not forced to even use classes. though now that I look at the docs.
Of course Python is a scripting language while Java is a proper programming language so as you mention in Java a lot of stuff is much stricter. I really like the autoboxing feature, and am wondering why they created generics instead of just sticking to autoboxing. Of course generics have one or two advantages but I’m not so sure that they’re worth it if you look at the complexity you’re adding.