Modified to support Django 1.5+

Very minor API changes.