Add compatibility for Django 1.7