'Returns the paths for any external backend packages.'

def _ext_backend_paths(self):

    paths = []
    first_package_re = re.compile(u'(^[^\\.]+)\\.')
    for backend in settings.DATABASES.values():
        result = first_package_re.findall(backend[u'ENGINE'])
        if (result and (result != [u'django'])):
            backend_pkg = __import__(result[0])
            backend_dir = os.path.dirname(backend_pkg.__file__)
            paths.append(os.path.dirname(backend_dir))
    return paths
