Skip to content

Commit 3a62439

Browse files
committed
Add compatibility for py-django-debug-toolbar >= 4.4.6
1 parent 76f7d50 commit 3a62439

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

graphiql_debug_toolbar/middleware.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@
44
from django.template.loader import render_to_string
55
from django.utils.encoding import force_str
66

7-
from debug_toolbar.middleware import _HTML_TYPES
7+
from graphene_django.views import GraphQLView
8+
9+
import debug_toolbar
10+
11+
if debug_toolbar.VERSION < "4.4.6":
12+
from debug_toolbar.middleware import _HTML_TYPES
13+
else:
14+
from debug_toolbar.utils import _HTML_TYPES
15+
816
from debug_toolbar.middleware import DebugToolbarMiddleware as BaseMiddleware
917
from debug_toolbar.toolbar import DebugToolbar
10-
from graphene_django.views import GraphQLView
1118

1219
from .serializers import CallableJSONEncoder
1320

0 commit comments

Comments
 (0)