def import_from_setting(setting_name, fallback):
    """Return the resolution of an import path stored in a Django setting.

    :arg setting_name: The name of the setting holding the import path
    :arg fallback: An alternate object to use if the setting is empty or
      doesn't exist

    Raise ImproperlyConfigured if a path is given that can't be resolved.

    """
    path = getattr(settings, setting_name, None)
    if path:
        try:
            return import_string(path)
        except ImportError:
            raise ImproperlyConfigured('%s: No such path.' % path)
    else:
        return fallback