Published June 26, 2009
About two months ago, I quietly wrote and released a little Django application which generates cross-domain policy files for Flash (if you’ve never encountered this aspect of Flash, here’s an introductory article on how it works). I’ve done a bit of hacking on it in my spare time, and I’m pretty happy with it as an example of a simple, tightly-focused application; sometime soon I hope to write a bit more about the development process behind it, because it provides a useful real-world guide to some ...
Published June 23, 2009
So just after lunch today a box arrived, containing copies of the second edition of Practical Django Projects, which went through final editing about a month ago (Apress tends to be pretty quick at getting the book printed and shipping). Since I assume that means other people will be getting copies of the book soon, I’d like to cover a couple important bits of information.
First of all, the second edition (as the cover proudly declares) covers Django 1.1. Which hasn’t yet released. There are three actual ...
Published June 3, 2009
So this afternoon I took a little break from running unit tests to head to the store and pick up a couple things. When I got back, I noticed I was no longer on IRC, and my client was reporting it couldn’t connect to the bouncer I run to stay online. I tried to SSH in to see if the bouncer had died, and discovered I couldn’t connect.
And couldn’t ping the box.
And couldn’t get this site to come up in a browser.
This site ...
Published March 28, 2009
I’m sitting about five rows back in the ballroom at the Hyatt, waiting for the ORM panel to begin.
Panel’s starting. Moderator Alex Gaynor introduces himself and panelists:
SQLALchemy: wanted to do a CMS, but never ended up writing it. Had idea for a modular library to talk to databases, different bits you could use or not use — connection pooling, SQL expressions, ORM — as ...
Published March 28, 2009
For anyone who missed it: I gave a lightning talk during the morning session here at PyCon today, following up on my earlier questions about distributed version control. Slides are available as a PDF.
Next up: attempting to live-blog the ORM panel.
Published January 18, 2009
So apparently some folks doing business as “Vyper Logix Corp” are peddling a thing they call “Django 2.0”. I’m not going to link it here since they don’t deserve the Google bump, but if you’re interested you can follow the link in Jannis’ tweet where he mentioned it. In fact, with any luck my Google juice will pop this article up above them.
“Django 2.0” is, apparently, built on the Django 0.96.2 codebase, which is rather interesting since that means it could be ...
Published January 9, 2009
Adrian announced today that he’s working on revising The Definitive Guide to Django to produce a second edition that covers Django 1.0, which is awesome news for anyone who’s used the book as a guide to learning Django.
In the same vein, I’d like to announce something that’s been unofficially mentioned a couple times but never fully clarified: I’m busy working on the second edition of Practical Django Projects, which will also cover Django 1.0 (and maybe a feature or two from Django ...
Published January 3, 2009
Doug Hellmann has brought a meme to my attention, and I’d be remiss in my duties if I didn’t act upon it.
Here’s how it’s supposed to work. Save a copy of this Python script, say as a file named oldest.py:
#!/usr/bin/env python """Print last-modified times of files beneath '.', oldest first.""" import os, os.path, time paths = ( os.path.join(b,f) for (b,ds,fs) in os.walk('.') for f in fs ) for mtime, path in sorted( (os.lstat(p).st_mtime, p ...
Published December 24, 2008
So, for as long as I can remember the single most-frequently-asked question about the Django admin has been some variation of “how do I set a foreign key to User to automatically be filled in with request.user?” And for a while the answer was that you couldn’t do that, really; it was and still is easy to do with a custom form in your own view, but up until a few months back it wasn’t really something you could do in the admin. Now, as of the ...
Published December 15, 2008
So yesterday I explained some of the reasons why I don’t like setuptools. In essence, my objections boil down to one idea: application packaging and application development should be orthogonal concerns. The way setuptools works, however, seems to tend, inevitably, toward coupling them to each other. I gave one example — the way the default behavior of installing zipped packages (an ironic twist: the man who so eloquently explained how Python is not Java has spent so much time and effort trying to implement Java packaging conventions in Python) leads ...
Published December 14, 2008
So currently there’s a bit of a to-do involving Debian’s Ruby packaging team and the Ruby “gem” system. This document does a good job of summarizing the issues from Debian’s perspective. And of course, the Ruby side of it is no less heated; an example is here.
A lot of this is the usual back-and-forth between (on the one side) application developers working in one particular language, who want to distribute their applications to the widest possible audience and so use an operating-system-agnostic but language-specific tool for ...
Published December 5, 2008
There’s an old joke, so old that I don’t even know for certain where it originated, that’s often used to explain why big corporations do things the way they do. It involves some monkeys, a cage, a banana and a fire hose.
You build a nice big room-sized cage, and in one end of it you put five monkeys. In the other end you put the banana. Then you stand by with the fire hose. Sooner or later one of the monkeys is going to go after ...
Published December 4, 2008
The other day at work I stumbled across my first opportunity to use a relatively-new feature in the Django admin, one which turned what had looked like it would be a fairly nasty task into, basically, a five-minute job (plus staging, testing and deployment, of course, but that happens no matter how long it takes to develop the code). I’ll get to the specifics in a minute, but first I want to give a little bit of background on what, exactly, I was working on, since it’s sort ...
Published November 29, 2008
Today my co-worker Daniel posted a class which performs content negotiation for Django views, allowing you to write a single view which returns any of several types of responses (e.g., HTML, JSON, XML) according to the incoming HTTP Accept header. While it’s certainly cool, he notes a couple of issues with it (including the redundancy it introduces in URL configuration).
So let’s see if we can’t come up with a way to work around this.
It seems that the best way to approach this ...
Published November 14, 2008
The other night in the #django-dev IRC channel, Russ, Eric and I were talking about custom management commands for certain types of common but tedious tasks; Eric was discussing the possibility of a command for automatically generating a tests module in a Django application, since he’s our resident unit-testing freak, and I started toying with the idea of one to generate basic admin declarations for the models in an application.
So I sat down and spent a few minutes writing the code. I haven’t decided yet whether I ...