modify some codes for Django