Changes for upgrade to Django 1.7