make changes to support django 1.7