def load_path_attr(path):
    i = path.rfind(".")
    module, attr = path[:i], path[i + 1:]
    try:
        mod = import_module(module)
    except ImportError as e:
        raise ImproperlyConfigured("Error importing %s: '%s'" % (module, e))
    try:
        attr = getattr(mod, attr)
    except __HOLE__:
        raise ImproperlyConfigured("Module '%s' does not define a '%s'" % (module, attr))
    return attr
dataset/ETHPy150Open pinax/pinax-blog/pinax/blog/utils.py/load_path_attr