Add compatibility to Django 1.6