flavors / django-graphiql-debug-toolbar

Django Debug Toolbar for GraphiQL IDE and Graphene
https://pypi.python.org/pypi/django-graphiql-debug-toolbar
MIT License
72 stars 22 forks source link

Add compatibility for py-django-debug-toolbar >= 4.4.6 #27

Open knobix opened 2 months ago

knobix commented 2 months ago

If django-graphiql-debug-toolbar is used with django-debug-toolbar 4.4.6 or newer, the following error is emitted:

[...] File "/usr/local/lib/python3.11/site-packages/graphiql_debug_toolbar/middleware.py", line 7, in from debug_toolbar.middleware import _HTML_TYPES ImportError: cannot import name '_HTML_TYPES' from 'debug_toolbar.middleware' (/usr/local/lib/python3.11/site-packages/debug_toolbar/middleware.py) [...]

This is because _HTML_TYPES has been moved from debug_toolbar.middleware to debug_toolbar.utils in the 4.4.6 release.

This should fix issue #26.

ulgens commented 1 month ago

Would be nice to check the version instead of the error, or at least have a comment about the case.