Syntax Highlighting with MarkDown, and a pinch of Automagick for Django

July 14, 2007. Filed under django 72python 56

It can be a bit awkward to implement MarkDown and Code Syntax highlighting together in your Django applications. But making them play nicely together doesn't have to be a hassle. Beyond that, its about time to teach your Django blog to automagickly create MarkDown references for you. If only it would stop begging at the dinner table...

Extracting Models From Django Datadump

July 13, 2007. Filed under django 72python 56

Last week I made a sweep of breaking changes (hopefully the last one for a long time) in my blogging software, and it would have required heroic efforts to coerce my old data into my new models. Instead I wrote a quick script that goes through dumped data and builds a folder hierarchy with each model in its own file. This makes changes easy enough to transfer your data by hand, but also makes it easier to write more detailed conversion scripts that only have to deal with one model at a time.

Creating my Dream Server for Django

July 13, 2007. Filed under django 72postgresql 4slicehost 4ubuntu 4memcache 3lighttpd 2

Recently I redid my server to have a solid Django serving atmosphere: apache2, Python 2.5, memcached, lighttpd for serving static media. These are the cleaned up and formatted notes I used to guide myself through the installation process on my 256 meg SliceHost slice.

How to Migrate Data Across Model Changes

July 1, 2007. Filed under django 72python 56

If you've built a large program in Django (or, ya know, anything that uses a database), you know about migrating data. Specifically, you know that you hate migrating data, and that you'd rather use a badly thought out model and waste hours with a bad design decision than simply fixing the tables and the existing data. Well, say goodbye to your data migration angst, 'cause baby, its going away.

Writing Custom Contexts for Django

July 1, 2007. Filed under django 72python 56

Writing custom contexts for Django is a powerful way to extend generic templates, or to simply avoid writing repetitive code when you need the same content to be available to a number of templates. They are also fantastically simple to use