Add compatibility for Django 1.6