diff --git a/rest_framework/compat.py b/rest_framework/compat.py index 47122ca84..a085187aa 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -214,7 +214,7 @@ except ImportError: try: import pygments - from pygments.lexers import get_lexer_by_name + from pygments.lexers import get_lexer_by_name, TextLexer from pygments.formatters import HtmlFormatter def pygments_highlight(text, lang, style):