django 1.5 compatibility + local changes