def l(path):
 if (path and path.startswith('/')):
  base_url = getattr(settings, 'SCRIPT_NAME', '')
  return (base_url + path)
 return path

def l ( path ) : if ( path and path . startswith ( '/' ) ) : base_url = getattr ( settings , 'SCRIPT_NAME' , '' ) return ( base_url + path ) return path
filter urls adding base_path prefix if required .