@classmethod<EOL><INDENT>def health_check(cls):<DEDENT>
try:<EOL><INDENT>assert isinstance(settings.MIDDLEWARES, list)<EOL><DEDENT>except AssertionError:<EOL><INDENT>yield HealthCheckFail(<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>)<EOL>return<EOL><DEDENT>for m in settings.MIDDLEWARES:<EOL><INDENT>try:<EOL><INDENT>c = import_class(m)<EOL><DEDENT>except (TypeError, ValueError, AttributeError, ImportError):<EOL><INDENT>yield HealthCheckFail(<EOL>'<STR_LIT>',<EOL>f'<STR_LIT>',<EOL>)<EOL><DEDENT>else:<EOL><INDENT>if not issubclass(c, BaseMiddleware):<EOL><INDENT>yield HealthCheckFail(<EOL>'<STR_LIT>',<EOL>f'<STR_LIT>'<EOL>f'<STR_LIT>',<EOL>)<EOL><DEDENT><DEDENT><DEDENT>
Checks that the configuration makes sense.