Skip to content

Conversation

knobix
Copy link

@knobix knobix commented Jul 14, 2024

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.

If py-graphiql-debug-toolbar is used with py-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 <module>
      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 py-django-debugtoolbar "_HTML_TYPES" has been moved from
"debug_toolbar.middleware" to "debug_toolbar.utils" in the 4.4.6 release.
Copy link

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested on NixOS and works as expected

@ulgens
Copy link

ulgens commented Jul 31, 2024

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

@AlexCLeduc
Copy link

Appreciate the fix! When can we expect this to be deployed? It's been a few months now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants