Photo of Seemant

Seemant's Blog

Apr 10 2007

Building My Django Weblog

Categories: , , Filed by: Seemant Kulleen
3 Comments Subscribe to this entry's comments RSS feed Subscribe to this entry's comments Atom feed

For quite a few months, I'd been wanting to build my own weblog. You might recall that I had started using Django to code up my ex-employer's websites. Well, that was a fantastic experience, educationally, because I got exposed to a really great framework. As part of that effort, I rebuilt their rather simple blog (which was -- and probably still is -- hosted at Typepad, leaving the website interface a little klunkily inconsistent)

Anyway, Aimee and I started talking about having our own web space. Otherwise, her blog and my blog would be hosted in separate neighborhoods on the web, which does nobody any good, really. So, I decided to take the code I'd written up for StreamBase and use it for my own site. Along the way, I kept reading James' blog especially the bits about generic views and application/project layout and, of course, hacking the FreeComment model.

In the #django channel, bitprophet would teach me how to wrap generic views and do other tricky (for me!) things. Meanwhile Colin (Magus-) would help me with basic Django things that everyone should know, but I didn't.

So, I started hacking away at it. Every day, I would upload a tarball for Tom to look at and give me his opinions and feedback. Those were invaluable chats. As it started to come together, my confidence increased and I started delving into templatetags and other such loveliness.

And then the code sat there while I was trying to figure out how to import my old Planet Gentoo feed into the new code and database layout. I'd decided I was definitely not going to use mysql (I've never liked it), so that meant I was changing databases as well.

Meanwhile, I discovered the django tagging application just in time. I was about to embark on a very hacky tagging implementation of my own when I discovered that. To boot, it does tag clouds fairly well (see the sidebar on the right). It's a drop-in application, which makes it superbly nice, and it's fairly easy to work with. So far, I only have two complaints. First (and I've made a ticket for it) I'd like the tag cloud to not be global. So, if I had my way, the main blog page would show the complete tag cloud from all the bloggers (admittedly, right now, it's just me), and my blog page would show the tag cloud that I've generated only. The second issue is perhaps with the tag cloud generation itself: I'd like to have 6 levels of font sizes, but the cloud really only gives me 4: 1, 2, 3, and 6. The middle two never show up at all, and I have no idea why. I really hope the upstream developer returns soon.

Anyway, just today, I finally added per-blog feeds. In keeping with the simplicity, to access the comments feed for any particular post, just append /rss/ or /atom/ to the end of the entry's URL. I'll even wait while you try it on this post :)

So, anyway, I'll start to document my code in upcoming posts. I'm not quite as ambitious as falling bullets but if any of my code will help someone that'll be great.

Edit: spelling error fix from nightmorph

Edit: fixed the links to James' blog posts, thanks to Grant's comment

Permanent Link
Subscribe to this entry's comments RSS feed Subscribe to this entry's comments Atom feed

3 Comments

United States Comment by Grant Goodyear after 19 hours, 21 minutes

The links for James' blog pages fail with the final "/". Thanks for the post; I've been meaning to learn more about django.

Incidentally, you might want to see liquidx's blog for insane comment spiffyness.

United States Comment by Seemant Kulleen after 20 hours, 24 minutes

Hi Grant!

Thanks for spotting the broken links. They should be fixed now. Alastair's entire website is simply beautifully done. It's so well designed, it's unreal.

I hope, at some point, to augment these pages with a bit of javascript magic, but I'm still sorting out the basic kinks :)

United States Comment by cbmeeks after 3 weeks, 6 days

Great tutorial/blog!

I've recently discovered django and I've been itching to learn Python. I am finding that django is much easier for me to follow than cakephp.

http://www.signaldev.com

Join the conversation