def _load_all_namespaces(resolver):
 url_patterns = getattr(resolver, 'url_patterns', [])
 namespaces = [url.namespace for url in url_patterns if (getattr(url, 'namespace', None) is not None)]
 for pattern in url_patterns:
  namespaces.extend(_load_all_namespaces(pattern))
 return namespaces

def _load_all_namespaces ( resolver ) : url_patterns = getattr ( resolver , 'url_patterns' , [ ] ) namespaces = [ url . namespace for url in url_patterns if ( getattr ( url , 'namespace' , None ) is not None ) ] for pattern in url_patterns : namespaces . extend ( _load_all_namespaces ( pattern ) ) return namespaces
recursively load all namespaces from url patterns .