# Path: speedinfo/utils.py
# def import_class(module_path):
#     """Import class by string path.
# 
#     :param str module_path: Path to class to import (e.g. 'speedinfo.profiler.Profiler')
#     :raises ImportError: if path to class is invalid
#     :return: imported class
#     """
#     path, class_name = module_path.rsplit(".", 1)
# 
#     try:
#         module = import_module(path)
#         return getattr(module, class_name)
#     except (AttributeError, ImportError) as e:
#         msg = "Could not import '{}'. {}: {}.".format(module_path, e.__class__.__name__, e)
#         raise ImportError(msg)


import django
from django.apps import AppConfig
from django.conf import settings
from django.core.checks import Error, Warning, register
from speedinfo.utils import import_class
                id="speedinfo.W001",
            ),
        )

    elif (cache_middleware_index is not None) and (profiler_middleware_index > cache_middleware_index):
        errors.append(
            Error(
                "speedinfo.middleware.ProfilerMiddleware occurs after "
                "django.middleware.cache.FetchFromCacheMiddleware in %s" % MIDDLEWARE_SETTINGS_NAME,
                hint="Move speedinfo.middleware.ProfilerMiddleware to before "
                     "django.middleware.cache.FetchFromCacheMiddleware in %s" % MIDDLEWARE_SETTINGS_NAME,
                id="speedinfo.E001",
            ),
        )

    elif profiler_middleware_multiple:
        errors.append(
            Error(
                "speedinfo.middleware.ProfilerMiddleware occurs multiple times in %s" % MIDDLEWARE_SETTINGS_NAME,
                hint="Add speedinfo.middleware.ProfilerMiddleware only once in %s" % MIDDLEWARE_SETTINGS_NAME,
                id="speedinfo.E002",
            ),
        )

    return errors


def check_cache_backend(app_configs, **kwargs):
    for params in settings.CACHES.values():
        if params.get("BACKEND") == "speedinfo.backends.proxy_cache":

# Path: speedinfo/utils.py
# def import_class(module_path):
#     """Import class by string path.
# 
#     :param str module_path: Path to class to import (e.g. 'speedinfo.profiler.Profiler')
#     :raises ImportError: if path to class is invalid
#     :return: imported class
#     """
#     path, class_name = module_path.rsplit(".", 1)
# 
#     try:
#         module = import_module(path)
#         return getattr(module, class_name)
#     except (AttributeError, ImportError) as e:
#         msg = "Could not import '{}'. {}: {}.".format(module_path, e.__class__.__name__, e)
#         raise ImportError(msg)


# Path: speedinfo/apps.py
import django
from django.apps import AppConfig
from django.conf import settings
from django.core.checks import Error, Warning, register
from speedinfo.utils import import_class

                id="speedinfo.W001",
            ),
        )

    elif (cache_middleware_index is not None) and (profiler_middleware_index > cache_middleware_index):
        errors.append(
            Error(
                "speedinfo.middleware.ProfilerMiddleware occurs after "
                "django.middleware.cache.FetchFromCacheMiddleware in %s" % MIDDLEWARE_SETTINGS_NAME,
                hint="Move speedinfo.middleware.ProfilerMiddleware to before "
                     "django.middleware.cache.FetchFromCacheMiddleware in %s" % MIDDLEWARE_SETTINGS_NAME,
                id="speedinfo.E001",
            ),
        )

    elif profiler_middleware_multiple:
        errors.append(
            Error(
                "speedinfo.middleware.ProfilerMiddleware occurs multiple times in %s" % MIDDLEWARE_SETTINGS_NAME,
                hint="Add speedinfo.middleware.ProfilerMiddleware only once in %s" % MIDDLEWARE_SETTINGS_NAME,
                id="speedinfo.E002",
            ),
        )

    return errors


def check_cache_backend(app_configs, **kwargs):
    for params in settings.CACHES.values():
        if params.get("BACKEND") == "speedinfo.backends.proxy_cache":

            return []