Other articles

  1. Strace to the rescue

    Recently I was debugging a strange error when using the eventlet support in the new the new coverage 4.0 alpha. The issue manifested itself as a network connection problem: Name or service not known. This was confusing, since the host it was trying to connect to was localhost. How …

    read more
  2. Custom redirects in the django admin

    On one of my sites i have a bunch of different models for various content resources, e.g. articles, videos and podcasts. For admins I wanted to add an "edit this item" link to the menu when browsing the site. Pretty easy: check permissions and add a link to the …

    read more
  3. Dynamically creating django models for m2m relationships

    Occasionally when using a django ManyToManyField I find myself wanting to query the join table directly. Consider for example the models below:

    class Category(models.Model):
        name = models.TextField()
    class Entry(models.Model):
        data = models.TextField()
        categories = models.ManyToManyField(Category)

    Suppose I have an entry, and want to find entries …

    read more
  4. Automating save-build-refresh on os x

    This blog is powered by Pelican. When I first started out, I was composing in vim, switching over to a terminal to build, and finally to my browser to preview the result. Clearly this becomes tedious pretty quickly.

    I was already familiar with tools to watch folders for changes and …

    read more
  5. Introspecting django urls for fun and profit

    One of the projects I work on has a fairly large and old code base, and is unfortunately somewhat lacking in the test suite department. We are working to improve this, but in the medium term we are stuck with a fair amount of manual testing.

    As part of some …

    read more