I don't understand why you say `if not u.startswith('/') and u.startswith('http')`. Wouldn't the fact that it starts with 'http' mean that it would not start with '/'? It seems like the first condition is unnecessary.