Fix support from Django 1.5 to 1.7