fix compatibility with django 1.7