def health_check(cls):
        """
        Checks that the configuration makes sense.
        """

        try:
            assert isinstance(settings.MIDDLEWARES, list)
        except AssertionError:
            yield HealthCheckFail(
                '00005',
                'The "MIDDLEWARES" configuration key should be assigned '
                'to a list',
            )
            return

        for m in settings.MIDDLEWARES:
            try:
                c = import_class(m)
            except (TypeError, ValueError, AttributeError, ImportError):
                yield HealthCheckFail(
                    '00005',
                    f'Cannot import middleware "{m}"',
                )
            else:
                if not issubclass(c, BaseMiddleware):
                    yield HealthCheckFail(
                        '00005',
                        f'Middleware "{m}" does not implement '
                        f'"BaseMiddleware"',
                    )