'Return one of the ReportStore subclasses depending on django
configuration. Look at subclasses for expected configuration.'

@classmethod
def from_config(cls, config_name):

    config = getattr(settings, config_name, {})
    storage_type = config.get('STORAGE_TYPE', '').lower()
    if (storage_type == 's3'):
        return DjangoStorageReportStore(storage_class='openedx.core.storage.S3ReportStorage', storage_kwargs={'bucket': config['BUCKET'], 'location': config['ROOT_PATH'], 'custom_domain': config.get('CUSTOM_DOMAIN', None), 'querystring_expire': 300, 'gzip': True})
    elif (storage_type == 'localfs'):
        return DjangoStorageReportStore(storage_class='django.core.files.storage.FileSystemStorage', storage_kwargs={'location': config['ROOT_PATH']})
    return DjangoStorageReportStore.from_config(config_name)
