I have a nice little pet project to work on … but I’m facing a bit of a dilemma right now. The project is a web-based tool to analyse information, and my debate is … which of the these 2x awesome tools should I use?
Django (which runs on the Python language) is what I’m currently experimenting with. And the one I’m thinking of using is CakePHP (which runs on the PHP language). Both Python and PHP are what I’d consider, “Scripting” high-level languages. Python is a great “glue” language. I feel Python has more promise than Perl for multi-developer situations, in that Python encourages good programming style, while Perl gives you enough rope to do the job, with left over to hang yourself, your tester, maintainer, and documenter with. PHP suffers a bit of the “spaghetti” criticism too.
I’m keen to use a tool that simplifies web development as much as possible, so I can concentrate on my pet project, and worry less about the low value-add stuff. I first thought of using Ruby on Rails (RoR) but I was rather turned-off by the feelings of the community towards its performance and governance structures.
So I’ve settled on something “similar” to RoR … I picked two frameworks that were in part inspired by RoR: Django and CakePHP.
One thing about Django is that the database layer doesn’t make you get down & dirty with SQL and similar tools. You’re always coding in Python. For example, when doing the “Model” part of the MVC paradigm, let me show you this example from the Django Book:
from django.db import models
class Publisher(models.Model):
name = models.CharField(maxlength=30)
address = models.CharField(maxlength=50)
city = models.CharField(maxlength=60)
state_province = models.CharField(maxlength=30)
country = models.CharField(maxlength=50)
website = models.URLField()
class Author(models.Model):
salutation = models.CharField(maxlength=10)
first_name = models.CharField(maxlength=30)
last_name = models.CharField(maxlength=40)
email = models.EmailField()
headshot = models.ImageField(upload_to='/tmp')
class Book(models.Model):
title = models.CharField(maxlength=100)
authors = models.ManyToManyField(Author)
publisher = models.ForeignKey(Publisher)
publication_date = models.DateField()
So far, my experience with Cake PHP is that the first step with developing an app with the framework is always to design the database first and make sure it’s properly normalised. This isn’t too bad to do in phpmyadmin, everyone’s favourite MySQL admin front-end.
So let’s see:
- Ruby on Rails (Ruby)
- Trade-off of computing performance vs. time-to-develop. (RoR is slow, but at least you develop fast). Although, this may be less of a good trade-off, given similar frameworks with better computing performance and similar time-todevelop.
- Has mod_passenger, an Apache module that can accelerate performance of RoR apps. This might alleviate some of the performance issues above.
- Not selected for further work – see Wired for more info.
- Django (Python)
- Not as straight forward to deploy as PHP. Requires some convoluted deployment strategies, and can be a headache in shared-hosting environments (i.e. places you don’t get root)
- Python is the new hawtness, and Django is also embedded as part of the Google App Engine.
- Poor resources available in Brunei, awesome online and built-in resources.
- CakePHP (PHP)
- Very easy to deploy on any web platform on any OS … Apache on Linux, IIS on Windows, etc etc.
- Plenty of resources available – coders w/ PHP skills, training courses, certification, books, magazines, etc.
- The framework is strict on code structure, which is an advantage in dispersed development teams.
At the end of the day … Django is a bit of a gamble right now (as is RoR for that matter!) for me to use for my pet project. If I want to get help in the future – people will be more interested if it’s a platform they are familiar with, and PHP is well-known by many, so there’s a bigger pool of interested people to draw from.
No related posts.

Pingback: Rapid development frameworks - CakePHP, Django, RoR - Relevance Found
I am in a similar dilemma … I went through the poll application tutorial for Django and the blog application tutorial for cakephp … I felt Django to be much faster in terms of development and customization as compared to cakephp (eg user authentication, validation modules etc are configurable in Django as compared with cakephp, which needs some amount of customization on top of it) … at the same time growing popularity and the amount of online support to cakephp left me a bit confused. It will be good to know which option you finally went for and why … thanks
Hi Kapil,
Actually, I went with Ruby on Rails in the end because I eventually lost my initial reservations about RoR.
So, after giving RoR a try, I closed off exploring the other options.
Here’s my take on it:
http://opensourcemissions.wordpress.com/2010/06/21/cakephp-vs-django/
Has your opinion changed since you posted this? Django has come a long way since then, as I imagine CakePHP has, too.
Not way… Django is big daddy