remove whitespace from string django template code example Example: django trim string whitespace sunny_leone = " sunny leone " x = sunny_leone.strip()