Fix for breaking changes in Django 1.6