Some Django 1.5 compatability fixes