Fix to fit Django 1.3 and 1.4