REV: compatiable with django 1.6