Add backwards compatibility for Django 1.3