Blog

Stable django deployments without downtime

This post describes a deployment and maintenance method for Django projects that was designed with scalability in mind. The goal is to push new releases into production at any moment with minimal or no downtime. Upgrades can be performed with unprivileged access to the production server, and rollbacks are possible. I use Gunicorn, Fabric and Supervisord in the examples. more

Wagtail and Streamfields

Django was always great for developers out of the box, but creating friendly admin interfaces was always a little too much work. This post explains why I now consider using Wagtail to make this task easier. more

CSS-only Terminal

Recently I wanted to nicely format some code, so I made a CSS-only terminal. The reason I think this one is nice is that it doesn't require any superfluous or non-semantic markup. It is very lightweight, which is good, but wasn't made to be interactive. It doesn't mimic any particular ... more

Android, nomedia and the audio library

I recently bought a new Android Phone with KitKat. This is the first time I'm using Android for more than simple phone calls and the occasional route planning. It's a quite decent OS. However, one thing that happened to me was a usability nightmare. I use the phone to listen ... more

Migrating Django projects with fixtures

When migrating a Django project it's often useful to work with the built-in dumpdata and loaddata management commands. However, this can easily lead to errors like django.db.utils.IntegrityError: Problem installing fixture Could not load foo.Bar(pk=ba): (1062, "Duplicate entry for key 'app_label'"). Such errors indictate that a similar object already exists in ... more

RuntimeError: App registry isn't ready yet

The upcoming Django 1.7 has many interesting and welcomed changes. One of them is an update to how applications are loaded. The relase notes also mention potential problems with these changes. I ran into RuntimeError: App registry isn't ready yet while using the self-contained tests approach, but the fix is ... more

Django-filter and custom querysets

Django-filter is a powerful tool, but the documentation is a little sparse. If you want to see examples of custom Filters you have to dive into the source code. I recently wanted to add a filter for methods on a custom QuerySet. Unlike custom managers, custom QuerySets allow you to ... more