Entries published in 2006

64 entries published in this year. See also: latest entries.

Merry Christmas

It’s Christmas Eve and I’m sitting at home with my family, and the most appropriate thing I can think of to do is to quote William Makepeace Thackeray:

My song, save this, is little worth;
  I lay the weary pen aside,
And wish you health, and love, and mirth,
  As fits the solemn Christmas-tide.
As fits the holy Christmas birth,
  Be this, good friends, our carol still:
Be peace on earth, be peace on earth,
  To men of gentle will.

Merry everything.

Entry published December 24, 2006. Read full entry.

I can’t believe it’s not XML!

As you may or may not have heard, JSON came to Dave Winer’s attention today. He is, quite obviously, of the opinion that this is just a reinvention of what people are already doing just fine with XML, thank you very much, so what’s the point?

Of course, this ignores the fact that the Lisp folks have been making the same argument for years, wondering why there was this great pressing need to go out and invent XML when s-expressions were just dandy.

But once you get past the egos and the ...

Entry published December 21, 2006. Read full entry.


The other day, the Dojo blog announced the public beta of Renkoo, an “evite killer” which relies heavily on the asynchronous features of Dojo and “Comet”, the name that’s been given to the use of long-lived HTTP connections to provide instant updates of state in event-driven web applications.

Except I can’t check out Renkoo in my browser of choice — Safari — because I get automatically redirected to their “unsupported browser” page. They have a brief write-up on their blog of why Safari support is problematic, though I can’t help thinking ...

Entry published December 18, 2006. Read full entry.

Status update

I know I haven’t been writing much lately, and that I haven’t been keeping up with useful Django articles as much as I should be, but there are reasons for that.

So I’m going to change course a little bit and focus on some non-Django stuff for a little while. I’ve got a backlog of miscellaneous things I’ve been writing and rewriting and I’d like to get them out the door; plus, between holidays, work, significant Django changes (mostly having to do with newforms) and some other stuff, I’m going to ...

Entry published December 10, 2006. Read full entry.

My site is smarter than I am

Looking through my stats today, I found an incoming link from a blog written entirely in Chinese. Now, I don’t read Chinese (I know about half a dozen words of Mandarin, but couldn’t begin to pronounce them with the right tones), so I ran it through Babelfish and found that this person was — apparently — commenting on how “comforting” my site was to him.

This left me somewhat befuddled, until I went back and looked at the comment he’d left here, and then at his screenshot of, sure enough, Chinese ...

Entry published November 22, 2006. Read full entry.

Django tips: get the most out of generic views

Recently at work I had the chance to revisit an application I’d written fairly early on in my tenure at World Online; I was still getting used to doing real Django development and to some of the quirks of our development environment, and ended up writing a lot more code than I needed to, so I was happy to be able to take a couple days and rewrite large chunks of the application to be more efficient and flexible.

The biggest win was more careful use of generic views, which this ...

Entry published November 16, 2006. Read full entry.

Comment problems

So it seems that something’s broken somewhere in all the hacks I do to the comment system, because every attempt to submit a comment is now met with AkismetError: missing required argument.

I’m working on it.

Update: commenting still won’t work, but apparently I’m not the only person running into this bug. I can’t find any notes regarding changes to the Akismet API, but that feels like the most obvious reason why this is suddenly happening.

Updated again: and just like that, things are working again. Judging from a couple other people ...

Entry published November 12, 2006. Read full entry.

Programming tips: learn optimization strategies

Recently I spent a little time talking about the tradeoffs between “concise” code and readable code in Python. Throughout that entry, I was using as an example a simple function which calculates numbers in the Fibonacci sequence; here’s one variation:

def fib(n):
    if n < 2:
        return n
    return fib(n-1) + fib(n-2)

The Fibonacci sequence is a classic example from introductory programming materials, because it teaches recursion, and recursion is an important core concept for productive programming. But it can also be useful for another educational topic ...

Entry published November 5, 2006. Read full entry.

Django tips: auto-populated fields

One of these days I’m going to run out of frequently-asked Django questions to answer. But today isn’t that day, so let’s look at one of the most common questions people ask: how do you set up a model with one or more fields that never show up in add/edit forms, and get automatically populated with some specific value?

A simple example

Let’s say you’re writing a to-do list application, and you want to have fields on the list model to store the date it was created and the time it ...

Entry published November 2, 2006. Read full entry.

Python tips: don’t be too concise

There’s an inherent tendency programmers have to take a piece of code and reduce it to the shortest possible form. The holy grail is, of course, cutting something down to a single line of code while still providing the same functionality; reducing a particular piece of code to a “one-liner”, especially if the code is somewhat complex, is sometimes viewed as a measure of a programmer’s intelligence or talent or both, and is often used as a sort of game (see Perl Golf, for example — the cult of the ...

Entry published October 28, 2006. Read full entry.

That’s not Popper!

In an entry posted the other day, Aaron Swartz expounded on a general observation that the “scientificness” (if I may coin a word) of a theory or discipline is roughly inversely proportional to the number of times the word “science” occurs in its name. Good examples include “creation science” and “Scientology”. This is certainly relevant material, and there are quite a few good, recent books on the subject (many of which, if you’re looking for an author to get into, have been written by Michael Shermer). But I couldn’t help ...

Entry published October 25, 2006. Read full entry.

The Prestige

I read the book The Prestige a while back, because it looked really interesting. And it didn’t disappoint; what started out looking like a feud between late-nineteenth-century stage magicians — which would have been cool in its own right — quickly turned into something much deeper and much more involved.

And the movie didn’t disappoint. The particular events it uses to drive the plot are different, but enough of the overall plot is the same, and is presented in a compelling enough manner, to keep it lively. It was also nice ...

Entry published October 22, 2006. Read full entry.

Django and NIH

Just so you know, Django is a smug, arrogant framework that doesn’t play nice with others. The developers are smug, arrogant assholes who don’t care what anyone else does or what other tools are available, and who always insist on doing things their way. Django absolutely refuses to support cool “standard” Python tools and libraries unless they were implemented first for Django. Just stay the hell away from it, and teach those goddamned Django people a lesson by doing so!

Or at least, that’s the impression you’d get from reading the ...

Entry published October 21, 2006. Read full entry.

How I got here

I’m not a formally-trained programmer. I wasn’t a computer science major in college (my degree is in philosophy), and my first job after graduation didn’t involve programming (it was phone-based customer service at a health-insurance company). But here I am, developing software for a living.

I’ve never written a compiler. I’ve never hand-tuned something by dropping in bits of assembly, or even by writing C extensions for an interpreted language. I’m too young to have ever hacked on a Lisp Machine. But here I am, developing software for a living.

My language ...

Entry published October 16, 2006. Read full entry.

Heads up

If you’re a regular reader of my blog it will be purely remedial reading, but an article I wrote about Django is up at Sitepoint as of this morning.

Go forth and spread the good word.

Entry published October 11, 2006. Read full entry.

The functional language that’s right under your nose

Recently I’ve been getting an itch to learn a functional programming language. I’ve made a couple attempts on Lisp over the years, with mixed results; I can write fairly basic Common Lisp, and hack on Emacs a bit, but I’ve never advanced much beyond that. I’d been looking at some of the trendy, popular functional languages (well, popular among certain circles) like Haskell, OCaml and Erlang, when I remembered that I already knew a functional language. In fact, part of the reason why I was hired at my current job ...

Entry published October 11, 2006. Read full entry.

Defenders of design theft

When a case of alleged design theft on the Web — the appropriation of one or more elements of a site’s design, without permission — is exposed, there is an elite group of mentally-challenged individuals who spring into action to defend said theft. Their arguments never vary; they stay the course and seem to assume that if they simply repeat themselves often enough, their lack of functioning neurons will be ignored.

Broadly speaking, these arguments fall into three categories. I pray you’ll forgive my abominable Latin grammar in describing them.

Turpem tuus

This ...

Entry published October 1, 2006. Read full entry.

Dear John

I don’t really know where I should begin, John. Maybe I could start with your unnecessary brutality over on Jeff’s blog. Maybe I could start with the rather nasty screed you left for me today. There are other things you’ve said that I could dig up and go through, but that’s not really where I should begin.

So let me start with my to-do list. There are about fifty things on it right now; in fact, there are pretty much always about fifty things on my to-do list. Most of my ...

Entry published September 20, 2006. Read full entry.

Django tips: laying out an application

Continuing the theme of dealing with common questions from the Django mailing lists and IRC channel, today we’ll look at how to organize the various bits of a Django-based project or application.

Projects versus applications

This is really more of a separate (though related) question, but understanding the distinction Django draws between a “project” and an “application” is a big part of good code layout. Roughly speaking, this is what the two terms mean:

Entry published September 10, 2006. Read full entry.

Django tips: documentation and resources

Django’s official documentation often draws praise for being well above average for an open-source project, but it’s far from being the only source of useful information for a developer using the framework. Also, articles and tutorials specific to Django aren’t the only useful documentation out there; the Python language in general tends to have tons of great resources. So let’s take a look at some resources you might not know about but should.

Python in general

For someone who’s new to programming in general, or for a programmer who’s new to Python ...

Entry published September 4, 2006. Read full entry.

Tool Wars

A long time ago, in a land far away, there lived people who were called “carpenters”, and their jobs consisted, in part, of the following tasks:

Now, the last one was particularly problematic, because it usually involved pounding a small metal connector — called a “nail” — through one of the pieces of wood and into another. Many carpenters working in small shops had to resort to ...

Entry published September 3, 2006. Read full entry.

Django tips: user registration

One of the most common and, generally, most successful models for letting people sign up for user accounts requires the user to go through some form of “activation”; usually it looks something like this:

  1. User fills out a form with a username, password and email address.
  2. User gets an email with a “confirmation link” which must be clicked to activate the account.
  3. User clicks the link and the account becomes active; then they log in normally.

So let’s look at how to do this with Django.

Also, before we dive in, let me note that ...

Entry published September 2, 2006. Read full entry.

Friday fun

It’s the end of the week and, while I’ve got plenty of things I could write about, I’m sort of tired and burned out. So let’s just look at a couple things that went on this week.

Django performance with foreign keys

There’s been a bit of a to-do the last few days over a supposed performance problem in Django. I have a hard time classifying it as a “bug”, though — the whole thing centers around the fact that, to generate an HTML select box of possible choices for a foreign ...

Entry published September 1, 2006. Read full entry.

The Rules

So today I got to wade through the joyful experience of cancelling my account with a business which shall remain nameless (unless, of course, they didn’t actually cancel the account — in which case they shall be named and shamed and several other things as well).

The experience was less then pleasant both for me and the poor customer-service rep who had to take my call, so I’d like to suggest some general guidelines on how this could have gone better. If you want me to be a happy customer, even ...

Entry published August 29, 2006. Read full entry.

The best of all worlds

Every once in a while, someone will complain on the Django users mailing list that they feel our ORM doesn’t offer all the features they need, and it’s true that there are a few exotic and/or advanced things that it can’t handle. Usually the standard people compare to is SQLAlchemy which can be, unfortunately, extremely complex to learn and use. A related — and inaccurate — complaint is that it’s possible to use Django with SQLAlchemy, but that you’d lose the admin app (you wouldn’t; using the admin while ...

Entry published August 29, 2006. Read full entry.

A Web 2.0 service idea

One of these days, someone should start a socially-based translation service for blogs.

You see, it’s not uncommon, this being the World Wide Web, to get incoming links from articles written in languages you don’t necessarily speak; for example, my recent post about accessibility got attention from a German-language blog and, sadly, I don’t understand more than a few words of the language (I also got linked up by a French-language blog, but I can get by in French).

So a pretty cool service might work like this:

  1. You sign up, and list ...

Entry published August 28, 2006. Read full entry.

Let’s talk about accessibility

The other day, Jeff posted some thoughts about accessibility which were, for the most part, well-received. Some people apparently didn’t get the message, though, and went after him in the comments, so he had to post a follow-up clarifying that, no, he’s not an evil corporate monster who hates handicapped people.

Jeff’s first post was somewhat kicked off by Roger Johansson’s post on Monday, which had comments that got so bad he had to close them for a while, then re-open them with a note:

Comments are open again. You are free ...

Entry published August 25, 2006. Read full entry.

Trying something new

Following up on yesterday’s feed subscription housecleaning, today I noticed that, if you buy a NewsFire license before day’s end you’ll get a nice bonus: Inquisitor thrown in free of charge.

Well, hot damn!

Inquisitor is really the big win for me here; I’m trying to get into the habit of using Safari as my day-to-day browser, since I’m doing lots of JavaScript stuff and — though this is in no way a knock against Dave Hyatt and the WebKit team, or the KHTML team — I’ve always tried to have a ...

Entry published August 20, 2006. Read full entry.

A modest proposal

As a lifelong baseball fan somewhat dismayed with the currently-available coverage of the sport, I’d like to propose a change to the structure of the major leagues which might make things a bit more bearable, especially as we head into the waning days of the regular season: all it requires is adding a third league. I know this will be controversial, but bear with me.

The problem

In any given area of the country, your televised baseball viewing choices are generally limited to:

  1. The nearest major-league franchise. In my case, the Kansas City ...

Entry published August 19, 2006. Read full entry.

Some long-overdue cleaning

It had gotten out of hand and out of control. It was impossible to deal with, and impossible to do without. It was eating more and more of my time every day, and finally I just had to kick it to the curb.

That’s right, I’m talking about my feed subscription list.

The new world order

Screenshot of my subscription list in NetNewsWire Lite, showing nine folders of feeds

It took about half an hour, but I’ve successfully pruned and reorganized my subscription list; where before the subscriptions pane in NNW Lite was a sprawling single list of pretty much everything I’ve read over the past ...

Entry published August 19, 2006. Read full entry.

I’m going to predict this now

Assuming they’re both still on TV in 2008, Jon Stewart and Stephen Colbert will both run for President. In different parties.

Entry published August 18, 2006. Read full entry.

Django tips: using properties on models and managers

While working on a little side project this week, I ran into a couple of very common use cases that often result in a lot of extra typing:

  1. Defining a BooleanField, or an IntegerField or CharField with choices which will, logically, break up instances of the model into certain groups which need to be accessed often.
  2. Repeatedly wanting to calculate a value based on the values of several fields of a model.

Let’s look at how to handle these common cases, while reducing the extra typing and making them behave in an extremely ...

Entry published August 18, 2006. Read full entry.

Quick note for pydelicious users

If, as I do, you use pydelicious to handle automatically posting links to del.icio.us, you’ll want to take note of the fact that the switch of the del.icio.us API‘s location, previously announced, has happened.

It doesn’t look like pydelicious has updated (and given the spamfest that is their Trac, I wonder if it’s being maintained), so in the meantime here’s the quick fix:

Crack open pydelicious.py, and change lines 91 and 94 to reflect the new API locations; line 91 should become

DWS_HOSTNAME = 'https://api.del ...

Entry published August 15, 2006. Read full entry.

Let’s talk about frameworks, security edition

It’s been an exciting week, hasn’t it?

The Rails vulnerability touched off quite a firestorm of commentary on the security of web application frameworks (and, by extension, applications developed with them), so let’s bring back the frameworks series for one last hurrah and take a look at security.

What do we mean by “secure”?

This may sound like a strange question to ask, but it’s an important one. A common misconception is that an application is “secure” if it doesn’t have any “bugs”. Setting aside the fact that this just switches out one ...

Entry published August 13, 2006. Read full entry.

Django tips: A simple AJAX example, part 2

Last time around we looked at how to write a simple view which processes a form and either returns errors or returns success, and then tweaked it slightly so that the same view could handle either a “regular” form submission (in which case it operates normally), or an XMLHttpRequest (in which case it returns JSON).

Today we’ll look at writing the JavaScript side of it; for reference, here’s the live example we’re going to build. This will be a fairly long write-up, but that’s not an indication of the complexity ...

Entry published August 5, 2006. Read full entry.

Django tips: A simple AJAX example, part 1

One thing that’s come up over and over again in the Django IRC channel and on the mailing lists is the need for good examples of “how to do AJAX with Django”. Now, one of my goals in life at the moment is to try to fill in the gaps in Django’s documentation, so…

Over the next couple of entries we’re going to walk through a very simple form, which will submit via AJAX to a Django view and handle the result without a page refresh. If you’d like, you ...

Entry published July 31, 2006. Read full entry.

Apropos of even less

One day real soon I’m going to start writing real blog entries again. But for the moment, I’m a bit too bogged down with various things, so I’m just going to continue sharing quick, amusing anecdotes.

Moments ago on IRC, Jeff posted one of the more amusing error messages we’ve ever come across:

tar: phpicalendar-2.22/phpicalendar/tmp/parsedcal-US%2520Holidays-2006: implausibly old time stamp 1969-12-31 16:00:00

Entry published July 25, 2006. Read full entry.

Apropos of nothing

So this morning we come in to work, and something’s wrong with all the chairs; they’ve been moved around or reset or something, because they’re not in their usual friendly-to-programmers-with-poor-posture configurations. We deal with it.

Until about thirty seconds ago, when Matt stood up and started trying out every empty chair in the office to see if he could find one that felt right. His reasoning:

Man, this Aeron’s throwing an ImproperlyConfigured!

Entry published July 24, 2006. Read full entry.

Helpers, scaffolding, tradeoffs and other stuff

In one of the very, very few coherent things I’ve seen him say in comments posted here and elsewhere, one Lucas Carlson brought up the other perceived advantage of JavaScript helpers: they save time:

Sure it is possible to add javascript helper functions to Django, and yes that would speed up initial development times and reduce bugs since Python is usually more terse than JS… even for expert JS programmers.

I’m going to ignore the “fewer bugs” argument because it seems to me that writing code in one language ...

Entry published July 17, 2006. Read full entry.

Django tips: Hacking FreeComment

Django’s bundled comments application (found in django.contrib.comments) is incredibly useful; it gives you a nice, out-of-the-box system for adding comments to any site. But, if you look at it closely, really feels more like two applications:

  1. The Comment model and its helpers, which only allows registered user accounts to post comments.
  2. The FreeComment model and its helpers, which allows anyone at all to post comments.

The first one — based around Comment — is much more complex by far, and includes pretty much everything World Online has ever needed for ...

Entry published July 16, 2006. Read full entry.

Independence Day

In CONGRESS, July 4, 1776.

The unanimous Declaration of the thirteen united States of America,

When in the course of human Events, it becomes necessary for one People to dissolve the Political Bands which have connected them with another, and to assume among the Powers of the Earth, the separate and equal Station to which the Laws of Nature and of Nature’s God entitle them, a decent Respect to the Opinions of Mankind requires that they should declare the causes which impel them to the Separation.

We hold these Truths to be ...

Entry published July 4, 2006. Read full entry.

JavaScript, ORM and “hiding SQL

So my little rant on AJAX support in Django apparently touched a nerve with a couple people; that means it’s time to write more about it.

One of the common points people have been raising, in comments and elsewhere, is that I shouldn’t rail against “hiding JavaScript from the developer” when Django’s ORM already hides SQL from the developer; from the perspective of a server-side developer, SQL is just as important, right?

Yes, SQL is just as important. But having ORM isn’t “hiding SQL”.

What ORM is

The intialism “ ...

Entry published July 4, 2006. Read full entry.

Django tips: scaling an application

In today’s ripped-from-the-mailing-list Django tip, we’ll be looking at a common scaling pattern: an application which starts out with one user, then has to gain separate “instances” for each of multiple users. And for bonus goodness, we’ll scale it even further to work on multiple sites simultaneously.

Let’s build a blog

For purposes of this example, let’s say that you’re building a blog with Django; that was the example in the mailing-list thread, so I’ll run with it, but there are lots of types of applications that could go through this process.

When ...

Entry published July 3, 2006. Read full entry.

Django and AJAX

One hot topic that keeps coming up over and over again on the Django mailing lists and in IRC has to do with when Django will get “AJAX support”. There are two answers to that question; one can be stated with authority, and the other consists entirely of my own unofficial and non-binding opinion. Let’s start with the first:

We’ve already got it, and more is on the way

Doing AJAX with Django has always been pretty easy, though maybe in a way that’s not obvious to users of other frameworks ...

Entry published July 2, 2006. Read full entry.


For the second time, Mark Pilgrim has written up a list of his “essential” software (for reference, here’s the first time). It being Friday, the day when bloggers around the world veer off and post things of very little relevance to important world issues, I feel compelled to do the same.

Wherever I go, there they are

I work with two operating systems on a regular basis: Mac OS X and Ubuntu GNU/Linux. Obviously there are going to be some disjoints between the sets of applications I use on the two ...

Entry published June 30, 2006. Read full entry.

Django tips: the difference between ‘blank’ and ‘null’

New users of Django, even people who have lots of experience writing database-driven applications, often run into a seemingly simple problem: how do you set up a model with “optional” fields that don’t always have to be filled in? Django’s validation system assumes by default that all fields are required, so obviously you have to tell it which fields it’s OK to leave blank.

But therein lies the problem: there are two different ways you can “leave it blank”.

There’s nothing…

For the most part, assuming that fields should be required is a ...

Entry published June 28, 2006. Read full entry.

Levels of openness knowledge

Level 0

You were upset when you heard about the DRM “lock-in” of Apple’s iTunes Music Store, so you burned all those locked-up files to CDs, then ripped them back in Windows Media Player. As WMA. You can’t play them on your iPod anymore, but at least you can play them on all the other portable music players you own.

You blog on MySpace. But you keep links on your MySpace page to your old LiveJournal and your old Xanga blog, so people can still read all your old entries there if ...

Entry published June 25, 2006. Read full entry.

Let’s talk about Python and Ruby

As a result of various things I’ve been reading up on recently, I’ve been exposed to far too many Python vs. Ruby flamewars. As someone who’s used both languages (though I’ve got much more experience with Python, and a Python-based framework is now how I make my living), I think they both solve similar problems in slightly different syntactical ways, and are pretty much equivalent on functionality.

But the debates, when they happen, always seem to come down to a few tired old arguments that just don’t hold up.

Ruby people say:

Entry published June 18, 2006. Read full entry.

Upgrading to Ubuntu 6.06

I’ve been a Linux user for about six years now; I started out with Red Hat while I was in college, and then a little over a year ago I jumped ship to Ubuntu because smart people kept talking about how nice it was.

Overall, my experiences with Ubuntu have lived up to that; Ubuntu does an amazing job of being both a great development platform and a good desktop operating system. That’s no mean feat. So naturally I was looking forward to upgrading to the recently-released version 6.06, code-named ...

Entry published June 16, 2006. Read full entry.

Django tips: Template context processors

Last time around we looked at how to write an effective template tag, with the focus on writing a flexible template tag that would make it easy to pull in various types of recent content in any page; I use a tag similar to the one in that entry to pull out the recent entries, links and comments in the footer of every page on this site.

For situations where you want to get content out of your database, a template tag is typically the best way to go, but consider ...

Entry published June 14, 2006. Read full entry.

How Django processes a request

In a comment he left yesterday, Jonathan Snook posed an excellent challenge: document the chain of how Django processes a request, from start to finish, with plenty of detail on the various things being called internally and links to the appropriate documentation.

Simon Willison once wrote such a document, but it was a fairly high-level view and a fair number of things have changed since then, so I’m going to take a stab at it myself, and hopefully the result will be comprehensible.

Note: this is a first draft. Not a finished ...

Entry published June 13, 2006. Read full entry.

Let’s talk about frameworks: When frameworks aren’t right

I know, I know, I said I was done with the series. But there’s one more thing I’ve been feeling like I should have mentioned: when frameworks aren’t the right choice for a project.

The big belly, revisited

A simple line graph which steeply curves upward from bottom left, then levels out and is mostly flat through its middle, then steeply curves upward again toward the upper right

Remember that image? It shows the types of projects for which I think frameworks are a good choice, the 80% or so of web projects which can all be handled by a database-driven application and gradual scaling of the hardware. Which, logically, indicates that other types of projects — basically, those which aren’t ...

Entry published June 10, 2006. Read full entry.

Installing the GIMP

Anil Dash has written up some complaints about installing the GIMP on Windows.

Special care should be used while reading that, because he does go through several very valid points:

But his ...

Entry published June 8, 2006. Read full entry.

Django tips: Write better template tags

Django‘s template tags are a great way to handle things that don’t always make sense being in a view. If you want to have, say, a list of recently-added content which appears in a sidebar or footer on every page of a site, it’d be crazy to manually change every view to fetch that content and add it to the template context; a template tag is definitely the way to go.

For example, in the footer of every page on this site, I pull out the five most recent entries ...

Entry published June 7, 2006. Read full entry.

Django tips: extending the User model

One of Django‘s great strengths is its built-in user and authentication system; the bundled application django.contrib.auth includes models for users, user groups and permissions and views for logging users in and out and changing and resetting their passwords. This is enough to cover the needs of a huge number of sites and, after the admin, the auth system is probably the most popular bundled application Django ships (or maybe the other way around, since the admin requires the auth system to be installed).

Because of the auth system’s ...

Entry published June 6, 2006. Read full entry.

Templating languages redux

So, I thought I’d explained why templating languages are pretty useful things. Markup is, after all, just about the fastest and simplest way to, well, mark up content for presentation and, when coupled with a small amount of logic, is by far the best way to present the output of a dynamic database-driven web application. I kind of hoped that I wouldn’t have to write more on the topic, because there are so many more interesting things to which I can devote my time.

Sadly, I was mistaken. Enter one Colin ...

Entry published June 5, 2006. Read full entry.

Let’s talk about frameworks, DBA edition

In the previous entry in this series I took a look at some common criticisms programmers level against the new generation of web-development frameworks. Today I’ll be following up in somewhat the same vein, by expounding on something that might lead your friendly local database administrator to look somewhat askance at how these frameworks do things.

And let me say right now, before I ruffle anyone’s feathers, that when I talk about applications and databases below, I won’t be talking about any particular application or database. I’m not engaging in thinly-veiled ...

Entry published June 4, 2006. Read full entry.

Let’s talk about frameworks, programmer edition

In the previous entries in this series I’ve been talking mostly about the benefits of the new web frameworks that have been popping up over the last year or so. And from a programmer’s perspective, there are certainly a number of benefits:

Entry published June 3, 2006. Read full entry.

Let’s talk about frameworks, designer edition

Yesterday we got a brief overview of the new generation of web development frameworks and a general idea of why people are so excited about them; today let’s dive in and see what frameworks can do for the designers in the audience.

You don’t have to do (much) programming

This is probably the biggest factor I’ve seen drawing design-oriented people to frameworks. There are plenty of people out there who’ve mastered HTML and CSS, but couldn’t program their way out of a paper bag. And a significant number of designers also ...

Entry published May 31, 2006. Read full entry.

Let’s talk about frameworks

So you’ve been hearing all this hype about “frameworks”. People from all over the world of web design and development are raving about the way their lives have been changed by things with mysterious names like “Rails” and “Django”, and you’re scratching your head, wondering what all the fuss is about — is this just a fad that’ll pass, or is this a geniunely important new development? Maybe you’re wondering just what, exactly, these “framework” things are, and what they can do for you.

Some of the answers to these questions ...

Entry published May 30, 2006. Read full entry.

Why templating languages aren’t a bad idea

Before I get into any meaty details, a quick question. You have a dynamic, database-driven web application and you’re ready to sit down and bang out its HTML output. One part of one page will be an ordered list containing comments left by visitors. You have the following choices for doing this:

Option A:

<ol class="comments">
{% get_comment_list %}
{% for comment in comment_list %}
<li>{{ comment }}</li>
{% endfor %}

Option B:

item = page.new_content_element('ol')
item.class = 'comments'
for comment in db.get_post(post_id)['comments']:
    c = item.new_subelement('li')
    c.contents ...

Entry published May 24, 2006. Read full entry.

Django, gzip and WSGI

One of the many things I like about Django is the range of available middleware you can use to do all sorts of interesting stuff. But one in particular has got me a little bit stumped.

One of the available middleware components for Django allows content to be gzipped for output when the client specifies ‘gzip’ in its Accept-Encoding header; this is handy because it both conserves bandwidth and allows pages to be downloaded more quickly. Most popular web servers allow this (Apache via mod_deflate, lighttpd via mod_compress, etc.), but it’s ...

Entry published May 21, 2006. Read full entry.

The Google Web Toolkit

So Google went and released something that people are calling an “AJAX toolkit” and, as so often happens whenever Google does something, the Internets are buzzing. But, in the long run, I don’t think this is going to be a game-changing move, and I think that should be pretty obvious to anyone who sits down and thinks about it.

The first question to ask about Google Web Toolkit is simple: who is it useful for? Obviously it’s useful for Google, but it looks an awful lot like it’s only really ...

Entry published May 21, 2006. Read full entry.

And away we go

So. That whole May 1 reboot thing? Yeah, it didn’t happen. But that’s OK, because the extra time let me get a little better run up to launching. But here I am, and here I’ll stay.

As anyone who knows me should expect, I’m now very happily powered by Django; developing the blogging app that’s behind this site was a lot of fun, and a whole lot easier than writing a blogging app has any right to be. I’ll write that up sometime in the not-too-distant future, and once a few ...

Entry published May 18, 2006. Read full entry.