Fix for Django 1.4+1.5 compatibility