Ben Godfrey

Moving my blog to Django

I’ve been meaning to move my blog to Django for about 2 years. I’ve got plenty of UI mockups, I just haven’t got around to coding anything. I decided instead to look at some of the pre-existing Django blog applications. It turns out there are at least a few that are quite complete.

Candidates

Django has been open source for over 2 years now, but it’s way behind something like Rails or PHP when it comes to packaged software. If I want a PHP blog, Wordpress is simply a great choice and there are many, many others. By stipulating Django, I’m narrowing the field quite severely. This may be because it looks trivially easy to build a blog in Django, and most people just roll their own.

After doing a bit of searching I unearthed these great projects.

  • Banjo
    A project that aims high: plugins, XML-RPC editing, importers, I’m just not sure how much of the functionality is stable.
  • BlogMaker
    A pretty complete app, sadly supports Django 0.96 only (see Trespams).
  • ByteFlow
    Perhaps the most complete and active Django blog project (thank you to Simon Willison for pointing me to it).
  • Coltrane
    James Bennett‘s blog tool, building on his django-comment-utils and django-template-utils projects.
  • Django Basic Apps blog
    Part of a larger suite of tools, this blog app isn’t as basic as it’s name makes out.
  • Django Project site blog code
    The original Django blog app and surely a starting point for many personal sites.
  • Diário
    A more internationalised take on the Django blog app.
  • Geeksite
    A whole geek site app featuring blog, CV (resumé) and project list.
  • Trespams
    A fork of BlogMaker which targets Django SVN but also attempts to be more like WordPress.

Some notes on software re-use

There is a low barrier to entry for starting a Django application. It’s very easy to create some models and check them in to Google Code. Creating a rounded reusable product takes much more. I had previously been sceptical about the completeness of the code on offer.

I have been reading Robert Glass’s excellent Facts and Fallacies of Software Engineering. He cites several studies which show that if 25% or more of a piece of software is not appropriate to your needs, then it is more cost-effective (in terms of time in my case) to start from scratch. If I modify one of the above apps, I become responsible for merging downstream bug fixes and maintaining my forked version. It would also be possible to take code from many apps to create the “perfect” blog tool, but I wouldn’t have access to improvements made by other people. It therefore is important to select a application that is a very good match for my needs off the peg. See Fact 19 in Facts and Fallacies of Software Engineering for a longer discussion of these issues.

There are certainly many more Django blog apps out there. I did not conduct an exhaustive search. These apps have been linked to from either the Django Resources page or I have seen them mentioned in previous reading. That a blog app came to my attention without much effort suggests a certain level of activity and so provides a valid filter for less advanced projects.

My requirements

The features I require:

  1. Write entries in Textile.
  2. Use the admin to write and edit posts.
  3. Pretty urls e.g. /2008/jun/01/moving-my-blog-to-django/.
  4. RSS feeds for posts, tags, ideally comments.
  5. Tags with tag cloud and items-with-tag views.
  6. Categories. I blog about hacking, cycling, business/startups, personal stuff and more. These posts have separate audiences.
  7. Comments with moderation.
  8. Write-edit-publish workflow to allow incremental authoring of posts.

Some nice to have features:

  1. Search (required, but trivially easy to build).
  2. Open ID authentication for commenting like Simon Willison has.
  3. Highlight source code snippets (this can be done in JS, e.g. SHJS).
  4. Ping Pingomatic on post.
  5. Sitemap generation.

I think lifestream applications like FriendFeed and tumble logs are very cool and I would really like my own one. Moving the blog to Django is the first step in building my own lifestream site. It gives me the foundation to build code on.

Django blog apps compared

Features 1-5 are found in every application considered here or can be added without modification to the core application, so I will omit them from the comparison matrix.

  Categories Comment mod Workflow Tag pages Search OpenID Highlighting Ping Sitemap Active project
Banjo N Y Y Y N N N Y N Updated Nov 2007
BlogMaker Y Y Y Y Y N N Y N Y
ByteFlow N Y Y Y N Y Y Y Y Y
Coltrane Y Y Y N N N N N N Basic maintenance
Django Basic Apps blog Y Y Y Y Y N N N Y Y
Django Project blog N Y N N N N N N N Basic maintenance
Di‡rio N N Y Y N N N N Y Y
Geeksite N N N N N N N N Y Updated Jan 2007
Trespams Y Y Y Y Y N Y Y N Updated Dec 2007

Conclusion

Although my feature matrix is skewed to my needs, it shows that the state of off-the-shelf Django blogging applications is improving. We certainly don’t have a WordPress or a Moveable Type yet but hopefully these applications will gain more attention leading to more feature contributions.

The matrix doesn’t really capture the different levels of work that have gone into the projects. I spent a bit of time looking at source code and their is a fair amount of variation. Diário and BlogMaker in particular are clearly more advanced than the average blog app. The Django Basic Apps project blog and Coltrane also appear fairly complete.

A big plus for many of these applications is how they integrate with other open source Django code available. django-tagging and django-comment-utils are almost ubiquitously used. An honourable mentioned has to go to Pinax/Hotclub, a really interesting project to create an integrated suite of applications that can be used to build a site on Django. There’s lots of code there, but a blog app is currently conspicuous by it’s absence! Any of the above applications would be an excellent choice for inclusion.

So which tool will I use to power my blog? I’m going to install ByteFlow locally and have a good play with it. If it is not a good fit or there are show-stopping issues, I may also install Trespams, the Django Basic Apps blog and possibly Diário or Coltrane.

Edited Jun 4, 10:30: Added ByteFlow (thanks Simon!)

Bookmark and Share

Comments

Simon Willison's avatar

Simon Willison

You missed out ByteFlow - http://byteflow.su/- which seems to be the most full featured and actively maintained of all of the current Django blog engines. It has most of your required features.
Cancel

Ben Godfrey http://aftnn.org

Damn, so I did. ByteFlow certainly does look full featured and active. Thanks for the recommendation.
Cancel
metapundit's avatar

metapundit

I think there's actually two different kinds of blog apps needed - I've been meaning forever to set up a blog on my professional site (simeonfranklin.com) that runs on django and even did a blog post on my personal site reviewing all the hits on google code for "django blog app" (see http://metapundit.net/sections/blog/django_applic.../>
I got excited when blogmaker was released (though Django 0.96 and Python 2.5 requirements put me off) and recently checked out ByteFlow as well. ByteFlow looks like the best bet for a full featured blog right now but I eventually just put up a simple blog from the Django-Basic-Apps.

Byteflow looks really cool to me for people who are looking for a wordpress replacement. My-site-is-a-blog (and I could edit settings file and add contrib.flatpages for the 3 static pages I want to add) type of thing. If you have an existing site and want to add a blog to it byteflow seems a little unfriendly purely based on the configuration (don't edit settings.py) and complexity (number of apps, etc).

This isn't a criticism of byteflow, really - I don't know that you can get around this. You need a certain number of apps and configuration to support all the things they do (openid server/client, pingbacks, livejournal, etc). For me - I just needed posts with nice urls and sitemap and feed classes already defined.... Basic Blog got me up right now and that's all I really needed.
Cancel
Alexander Solovyov's avatar

Alexander Solovyov

Yeah, that's a tradeoff, and we decided to go this way. BTW, you can easily extend INSTALLED_APPS and urlpatterns to get additional functionality.
Cancel
Roger Williams's avatar

Roger Williams

wow man sounds like you are reinventing the wheel a bit, but thats always been your bag with this coding stuff.

i am thinking about scrapping the custom all together and moving everything to wordpress.com =0
Cancel
mat's avatar

mat

this is your third blog post this year alone. are you sure django can handle the traffic? :)
Cancel

Ben Godfrey http://aftnn.org

Bite my shiny metal ass.
Cancel
James's avatar

James

Of your twelve features, at most only about four or five really should be implemented by a "blog" application; the rest are available either through applications in django.contrib, or through third-party applications (e.g., you don't really need to implement tagging views in a blog app, because django-tagging does it, and you don't need to implement a sitemap because contrib.sitemaps can do it).

Also, for lifestream stuff you want to have a look at jellyroll, which implements a generic tumblelog-style system that aggregates whatever types of ocntent you throw at it.
Cancel
James Bennett's avatar

James Bennett

Also, your OpenID implementation appears to be buggy, because it tossed me into a redirect loop that Safari eventually broke out of, and which posted a new copy of the comment each trip through the loop ;)
Cancel

Ben Godfrey http://aftnn.org

The OpenID implementation is provided by Intense Debate, a JS-based commenting system which I'm using as a stopgap. My old comment system just got spam flooded.
Cancel

Ben Godfrey http://aftnn.org

I disagree. I'm looking for a blog, not the tools to build a blog. I want to be able to get a site up and running with as little coding as possible. Hence the requirement that features like tagging and sitemaps just work. Sure I could code it all, but I've failed to get around to doing that for almost 2 years. This post was an admission of that failure as much as anything.
Cancel
Simon Willison's avatar

Simon Willison

You missed out ByteFlow - http://byteflow.su/- which seems to be the most full featured and actively maintained of all of the current Django blog engines. It has most of your required features.
Cancel

Ben Godfrey http://aftnn.org

Damn, so I did. ByteFlow certainly does look full featured and active. Thanks for the recommendation.
Cancel
metapundit's avatar

metapundit

I think there's actually two different kinds of blog apps needed - I've been meaning forever to set up a blog on my professional site (simeonfranklin.com) that runs on django and even did a blog post on my personal site reviewing all the hits on google code for "django blog app" (see http://metapundit.net/sections/blog/django_applic.../>
I got excited when blogmaker was released (though Django 0.96 and Python 2.5 requirements put me off) and recently checked out ByteFlow as well. ByteFlow looks like the best bet for a full featured blog right now but I eventually just put up a simple blog from the Django-Basic-Apps.

Byteflow looks really cool to me for people who are looking for a wordpress replacement. My-site-is-a-blog (and I could edit settings file and add contrib.flatpages for the 3 static pages I want to add) type of thing. If you have an existing site and want to add a blog to it byteflow seems a little unfriendly purely based on the configuration (don't edit settings.py) and complexity (number of apps, etc).

This isn't a criticism of byteflow, really - I don't know that you can get around this. You need a certain number of apps and configuration to support all the things they do (openid server/client, pingbacks, livejournal, etc). For me - I just needed posts with nice urls and sitemap and feed classes already defined.... Basic Blog got me up right now and that's all I really needed.
Cancel
Alexander Solovyov's avatar

Alexander Solovyov

Yeah, that's a tradeoff, and we decided to go this way. BTW, you can easily extend INSTALLED_APPS and urlpatterns to get additional functionality.
Cancel
Roger Williams's avatar

Roger Williams

wow man sounds like you are reinventing the wheel a bit, but thats always been your bag with this coding stuff.

i am thinking about scrapping the custom all together and moving everything to wordpress.com =0
Cancel
mat's avatar

mat

this is your third blog post this year alone. are you sure django can handle the traffic? :)
Cancel

Ben Godfrey http://aftnn.org

Bite my shiny metal ass.
Cancel
James's avatar

James

Of your twelve features, at most only about four or five really should be implemented by a "blog" application; the rest are available either through applications in django.contrib, or through third-party applications (e.g., you don't really need to implement tagging views in a blog app, because django-tagging does it, and you don't need to implement a sitemap because contrib.sitemaps can do it).

Also, for lifestream stuff you want to have a look at jellyroll, which implements a generic tumblelog-style system that aggregates whatever types of ocntent you throw at it.
Cancel
James Bennett's avatar

James Bennett

Also, your OpenID implementation appears to be buggy, because it tossed me into a redirect loop that Safari eventually broke out of, and which posted a new copy of the comment each trip through the loop ;)
Cancel

Ben Godfrey http://aftnn.org

The OpenID implementation is provided by Intense Debate, a JS-based commenting system which I'm using as a stopgap. My old comment system just got spam flooded.
Cancel

Ben Godfrey http://aftnn.org

I disagree. I'm looking for a blog, not the tools to build a blog. I want to be able to get a site up and running with as little coding as possible. Hence the requirement that features like tagging and sitemaps just work. Sure I could code it all, but I've failed to get around to doing that for almost 2 years. This post was an admission of that failure as much as anything.
Cancel

Add a new comment

Your avatar

Add a new comment

Cancel   Forgot password?
Cancel

Attention! Log in (if you've commented before) or use your OpenID.

You can use Markdown here.

Preview