Fix incompatibility with django-1.6