26 Oct 2005

new site engine using django


if you are reading this, then that means i have successfully switched from using drupal to my own homebrewed blogging site built using the fabulous django web framework.

i've been using drupal since october 2002, the month i started my phd in cambridge. and its been a great ride since it has turned out to be the cleanest code base and the most easily adaptable content management system (CMS) i've ever used.

but it is time to move on. ever since i laid eyes on django, i knew one day i'd be running my web site off this web framework. for one, it is in python, my favourite programming language (in case you don't know me.) admittedly i haven't spent time looking at cherrypy and turbogears, but i've already built one web app with django, and it just seemed like the obvious candidate to build my web site out of it.

why was drupal not the right fit?

1. drupal has a complex core

in order for drupal to be so flexible and allow for so many cool modules, its core is pretty complex. there are some neat things i like to do with my blog, but it just wasn't possible with drupal unless i branched their core code. i didn't want to maintain a branch like that.

2. i hate php

after years of programming in php, it was time to move on and as mod_python has matured, it is the natural progression to move to my favourite programming language.

3. drupal dev is way too high traffic to keep up

i'm subscribed to the drupal dev list but its been a real pain to keep up with in the last year or so. there are a couple thousand messages a month. not fun when i'm only an occasionally bug/patch submitter.

4. drupal is too able!

hard to believe, but i don't need so many features on my blog. i only need to post articles, photos and links. i don't need multi user features, i don't need people to login to comment, i don't need side bars, etc. using drupal made me find what i really wanted out of the system, and it was a very small subset of what drupal gave me. i maintained things that did comment filtering to combat spam, whereas moderation is essentially useless to me. in the end, there was so much fluff around the basic engine that i don't use -- that ended up getting in the way.

so what now?

i've got the basic blog up and running. actually that code was done last week, but the rest of the week i've been spending time writing scripts to port all the data from drupal's mysql database to django. it's been pretty painful because i've had to keep track of all the old "permalinks" and make them redirect properly to my new way of referencing blog entries (i really hated /node/3942093 as a url.)

there are still a couple of things i need to handle, some spam filtering middleware (that is what they call it in django-speak), search, atom feeds, xmlrpc and google sitemaps. but all of them should be pretty straightforward.

one other cool thing is to link with my own implementation of delicious -- well actually it is just a web based bookmark manager, so it is very far from delicious, but it is again the stripped down features of delicious that i use. i've started using this rather than delicious to flesh it out a bit more.

my delicious

i love delicious. its the most delicious thing since slice bread. but i wanted to have my own. problem is that that delicious is written in perl (my second least favourite language) and even if they decide to open up the code, i wouldn't want to touch it. essentially, delicious' core is very easy. the greatness of delicious is from the users in the system and also their scalability. i've been told about scuttle, but that is in php, so a no-go if i wanted to do something serious with it.

so i've written my own, and after fluffing around, it only really took me two hours to write it in django. that is a testament to how easy it is. i spent some more time trying to refine the engine to do multi-user, if i needed in the future, but i'm pretty sure i'm the only one who's going to use it.

i have some nice ideas for this part of my site, going to make use of some linkbacks to delicious, synchronise my bookmarks with delicious and play with a server-to-server implementation which would allow cross installation searches and aggregation, sort of like what delicious does, but decentralised.

we'll see how i go on that one. so that i about it for now. if you see some breakage, please let me know!


You can reply to me about this on Twitter: