def import_from_string(path):
    i = path.rfind('.')
    module, attr = path[:i], path[i + 1:]
    try:
        mod = import_module(module)
    except __HOLE__, e:
        raise ImproperlyConfigured(
            'Error importing module %s: "%s"' % (module, e)
        )
    try:
        instance = getattr(mod, attr)
    except AttributeError:
        raise ImproperlyConfigured(
            'Module "%s" does not define a "%s" attribute' % (module, attr)
        )
    return instance
dataset/ETHPy150Open lincolnloop/django-debug-logging/debug_logging/utils.py/import_from_string