Note:he order of MIDDLEWARE and MIDDLEWARE_CLASSES is important. You should include the Debug Toolbar middleware as early as possible in the list. However, it must come after any other middleware that encodes the response’s content, such as GZipMiddleware.