ported to Django 1.4.2