Skip to content

Entries published on November 14, 2008

1 entry published on this date. See also: all entries published in November 2008, full archive.

Writing custom management commands

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 want to clean it up into a proper patch against Django (which would require documentation and some other work), or just stuff it away somewhere to break out when I need it, but I thought the process would make an interesting write-up; although Brian and Michael have both written some tips for doing this, one can never have too many examples (and …

Entry published November 14, 2008. Read full entry.