Reliably Broken
More Python features that I really like
Another thing that makes using Python pleasing is decorators. A decorator is a wrapper for a function (or method) that takes a function (or method) as an argument and returns a new function (or…) which is then bound to the name for the original function.
May 28, 2010
Nginx and Wordpress
My Nginx and Wordpress configuration on Debian Linux 5 (Lenny). This has Nginx as the Web server using the fastcgi module to talk to php-cgi processes that run Wordpress with pretty URLs.
May 1, 2010
Split a file on any character in Python
I need to split a big text file on a certain character. I expect I am being thick about this, but split doesn’t quite do what I want because it includes the matching line, whereas I want to split right on the matching character.
April 15, 2010
Django AdminForm objects and templates
I can’t find documentation for the context of a Django admin template. In particular, where is the form and how does one access the fields? This post describes the template context for a generic admin model for Django 1.1.
April 4, 2010
Using MacPorts behind a firewall
I failed to persuade MySQLdb to build on a Mac OS X Server 10.5.8 install using the system Python + MySQL installation. So I turned to MacPorts where I know I can get Django + all the bits working without much hassle (but with much patience).
March 31, 2010
Confused of Wapping
Trying to get my head straight about what it means to modify a file and what it means to modify a folder for a desktop operating system. Mac OS X’s behaviour feels intuitively wrong, but turns out it is much harder than I expected to nail down exactly why it is wrong.
March 28, 2010
watchedinstall is useful
Very satisfying to use watchedinstall at work the other day to see exactly what a tricksy meta-package was doing during installation. Now that I fixed a stupid bug involving dtrace, watchedinstall works a treat for recording exactly what goes where.
January 30, 2010
AJAX-ified result paging is not good
An annoying trend in Web design: using AJAX to load results when there is more than one page.
January 30, 2010
ModelForms good for importing too
If you have exported data from one database in plain text format and you want to import it to Django, you should use a ModelForm class to do a lot of the heavy lifting for you.
January 26, 2010