Published December 31, 2007
So, let me straighten a few things out.
First off, this is my personal blog. What you see here is me speaking my own personal mind, and I neither represent nor want to represent anything larger: not Django, not Python web development, not my employer, not anything except me and whatever I feel like writing about. This is an important point to keep in mind, because I don’t have any claim to represent anything else:
Published December 31, 2007
For a little while now I’ve been trying to stay out of Python framework debates, partly because I just haven’t had the time and partly because things seem to be taking a turn for the nasty again. But recently it’s been harder and harder to keep away, especially with the hard work of a new entrant into the arena: Noah Gift, whose blog posts at O’Reilly have, in the last month or so, put him into serious contention for Jackass of the Year honors in this ...
Published December 17, 2007
The world of standards-based web design and development has been undergoing something of a shake-up these past few days; Andy Clarke’s “CSS Unworking Group” seems to have opened the floodgates to expressions of dissatisfaction with the current method of progress (or lack thereof) in developing and standardizing new features for web developers and designers. Alex Russell’s “The W3C Cannot Save Us” and my friend and former colleague Jeff Croft’s “Do we need a return to the browser wars?” continue the theme, as does Stuart Langridge’s “Reigniting ...
Published December 12, 2007
First off, if you’re going to PyCon (Chicago, March 14-16), make some room on your schedule; there are several interesting talks on Django scheduled, including one by yours truly.
The description of my talk on the PyCon site is somewhat pithy on account of space restrictions, but conveys the general idea of what I’ll be talking about; flexible, reusable Django applications are one of my pet topics, and I’ll be covering some techniques and best practices picked up from a couple years of real-world work with and ...
Published December 11, 2007
Just a quick tip today: someone on IRC tonight was asking for an easy way to write a Django view which restricts itself to only allowing a specific HTTP method or methods. For example, a web-based API might want to only allow POST to specific views.
This is actually pretty easy to do with a set of decorators built in to Django, in the module django.views.decorators.http. Specifically, the fix for ticket #703 added three useful things to that module:
require_POST is a decorator which checks that the ...Published December 9, 2007
Today marks two releases, both numbered 0.4, of django-registration and template_utils.
The new release of django-registration is largely a matter of policy; there’s no new functionality or features, but there is one backwards-incompatible change: the validation of passwords (verifying that the same password is entered in both fields) has been moved to the clean() method of RegistrationForm, which means that the error message from a password mismatch is now accessed via form.non_field_errors() instead of form.errors[‘password2’]. It’s a relatively easy change to make in your ...
Published December 4, 2007
Over the last couple days I’ve spent some time discussing the word “magic” and exploring just what it really means, with an emphasis on the fact that a lot of “magic” in programming — though initially counterintuitive and not at all what you’d expect to have happen (and it’s precisely this reason which usualy makes “magic” a bad idea) — boils down to applications of fairly simple principles. As a real-world demonstration of that, yesterday we saw how to build a Python module object dynamically and make it work ...
Published December 3, 2007
In yesterday’s article I spent a fair amount of time talking about the word “magic”, specifically in the context of Clarke’s Third Law, which states that
Any sufficiently advanced technology is indistinguishable from magic.
A big part of what I was getting at was that a lot of things which seem to be explicable only by appealing to “magic” are really just cases of technology — sometimes extremely simple technology — being used in a complex way. Or, to borrow an excellent turn of phrase from Terry Pratchett, “ninety percent ...
Published December 3, 2007
Every so often, a TV producer who wants to get ratings will air a “documentary” about some wonder of the ancient world. Say, the great pyramids at Giza. The formula for this “documentary” is pretty simple: you get a bunch of people from modern, industrialized nations to go crawl over these huge ancient monuments in Egypt and speculate on how those ancient Egyptians managed to build them. And, inevitably, a lot of these people will throw their hands up and decide that the Egyptians must have had help from aliens ...