Fixed #14664 -- Logged a warning if MiddlewareNotUsed is raised in DEBUG mode.