{"id":8948,"library":"django-graphiql-debug-toolbar","title":"Django GraphiQL Debug Toolbar","description":"django-graphiql-debug-toolbar integrates the powerful Django Debug Toolbar into the GraphiQL IDE, allowing developers to inspect SQL queries, cache hits, CPU time, and other performance metrics directly within their GraphQL development environment. It currently stands at version 0.2.0, with a release cadence that has been infrequent since its last major update in 2021.","status":"active","version":"0.2.0","language":"en","source_language":"en","source_url":"https://github.com/flavors/django-graphiql-debug-toolbar","tags":["Django","GraphQL","GraphiQL","Debugging","Debug Toolbar","Graphene"],"install":[{"cmd":"pip install django-graphiql-debug-toolbar","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Core framework dependency; version 0.2.0 requires Django >=2.3.","package":"Django","optional":false},{"reason":"Provides the underlying debug toolbar functionality that this library extends.","package":"django-debug-toolbar","optional":false},{"reason":"Typically used in conjunction with GraphiQL for building GraphQL APIs in Django.","package":"graphene-django","optional":true}],"imports":[{"note":"This library replaces the standard Django Debug Toolbar middleware to integrate with GraphiQL.","wrong":"from debug_toolbar.middleware import DebugToolbarMiddleware","symbol":"DebugToolbarMiddleware","correct":"from graphiql_debug_toolbar.middleware import DebugToolbarMiddleware"}],"quickstart":{"code":"# settings.py\n\nimport os\n\nDEBUG = True # Must be True for the toolbar to show\n\nINSTALLED_APPS = [\n    # ... other Django apps\n    'django.contrib.staticfiles',\n    'debug_toolbar',\n    'graphiql_debug_toolbar',\n    # 'graphene_django' if using Graphene,\n    # ...\n]\n\nMIDDLEWARE = [\n    # ... other middleware\n    'django.middleware.security.SecurityMiddleware',\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    'django.middleware.common.CommonMiddleware',\n    'django.middleware.csrf.CsrfViewMiddleware',\n    'django.contrib.auth.middleware.AuthenticationMiddleware',\n    'django.contrib.messages.middleware.MessageMiddleware',\n    'django.middleware.clickjacking.XFrameOptionsMiddleware',\n    # Ensure this comes after other middleware that might encode content\n    # and before any middleware that modifies the response too much.\n    # Replace the standard DebugToolbarMiddleware with the GraphiQL version\n    # 'debug_toolbar.middleware.DebugToolbarMiddleware',\n    'graphiql_debug_toolbar.middleware.DebugToolbarMiddleware',\n    # ...\n]\n\nINTERNAL_IPS = [\n    '127.0.0.1',\n    # Add other internal IPs if you're developing in a container/VM\n    # '10.0.2.2', # For Android emulator if running Django in Docker\n]\n\nSTATIC_URL = 'static/'\n\n# urls.py (in your project's main urls.py)\n\nfrom django.conf import settings\nfrom django.urls import include, path\n\nurlpatterns = [\n    # ... your other url patterns\n]\n\nif settings.DEBUG:\n    urlpatterns += [\n        path('__debug__/', include('debug_toolbar.urls')),\n    ]","lang":"python","description":"To quickly set up `django-graphiql-debug-toolbar`, first install it and `django-debug-toolbar`. Then, modify your Django project's `settings.py` by adding `debug_toolbar` and `graphiql_debug_toolbar` to `INSTALLED_APPS`. Crucially, replace the default `DebugToolbarMiddleware` with `graphiql_debug_toolbar.middleware.DebugToolbarMiddleware` in your `MIDDLEWARE` list. Ensure `DEBUG` is `True` and `INTERNAL_IPS` is configured. Finally, include the `debug_toolbar.urls` in your project's `urls.py`, typically conditional on `settings.DEBUG`."},"warnings":[{"fix":"Upgrade Django to version 2.3 or higher, or pin `django-graphiql-debug-toolbar` to version <0.2.0.","message":"Version 0.2.0 removed support for Django versions older than 2.3. Ensure your Django project is on version 2.3 or higher before upgrading to 0.2.0.","severity":"breaking","affected_versions":"0.2.0 and later"},{"fix":"Verify `django-debug-toolbar` is correctly installed and its basic functionality works. Check GitHub issues for known incompatibilities with specific `django-debug-toolbar` versions and consider pinning an older compatible version if issues arise.","message":"The toolbar requires `django-debug-toolbar` to be properly installed and configured first. Incompatibilities with `django-debug-toolbar` versions 4.4.6 or newer have been reported.","severity":"gotcha","affected_versions":"All versions, especially 0.2.0 with newer `django-debug-toolbar` versions."},{"fix":"Ensure `graphiql_debug_toolbar.middleware.DebugToolbarMiddleware` is placed early in `MIDDLEWARE`, typically after Django's core middlewares but before any complex custom ones.","message":"The `DebugToolbarMiddleware` must be placed correctly in your `MIDDLEWARE` list, ideally early but after any middleware that compresses content (like `GZipMiddleware`) and before any that might alter responses too heavily. Incorrect placement can prevent the toolbar from appearing or functioning.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Set `DEBUG = True` in your `settings.py` for development. Add your local IP address (e.g., '127.0.0.1') to `INTERNAL_IPS`. If running in Docker or a VM, ensure `INTERNAL_IPS` includes the appropriate host IP.","message":"The Debug Toolbar will only display if `settings.DEBUG` is set to `True` and the request's IP address is included in `settings.INTERNAL_IPS`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"1. Verify `DEBUG = True` and `INTERNAL_IPS` includes your request IP. 2. Clear your browser cache. 3. On Windows, ensure `.js` files are served with `Content-Type: text/javascript` by checking/modifying the registry `HKEY_CLASSES_ROOT\\.js\\Content Type`. 4. Ensure `graphiql_debug_toolbar.middleware.DebugToolbarMiddleware` is correctly placed in `MIDDLEWARE`.","cause":"Common causes include `DEBUG` being `False`, `INTERNAL_IPS` not configured correctly, browser caching issues, or incorrect MIME type handling (especially on Windows).","error":"The Debug Toolbar is not showing up in GraphiQL or any Django page."},{"fix":"1. Confirm Python, Django, and `django-debug-toolbar` versions are compatible. 2. Try isolating the issue by temporarily removing other `INSTALLED_APPS` or `MIDDLEWARE` entries. 3. In some cases, setting `PYTHONDEVMODE=1` before `runserver` might provide a stack trace on Ctrl-C.","cause":"This can happen if there's an incompatibility or a heavy check being performed by `django-debug-toolbar` or `django-graphiql-debug-toolbar` during startup, possibly related to specific Python, Django, or `django-debug-toolbar` versions.","error":"Server freezes or hangs at 'Performing system checks...' when `debug_toolbar` is enabled."},{"fix":"Ensure `django-debug-toolbar` is installed: `pip install django-debug-toolbar`. If using a virtual environment, ensure it's activated.","cause":"The `django-debug-toolbar` package, which is a core dependency, is not installed or not accessible in your Python environment.","error":"ModuleNotFoundError: No module named 'debug_toolbar'"},{"fix":"Check for known incompatibilities between `django-graphiql-debug-toolbar` and `django-debug-toolbar` versions on their respective GitHub issue trackers. Ensure all required `INSTALLED_APPS` and `MIDDLEWARE` entries for both libraries are present and correctly ordered.","cause":"This error usually indicates an issue within the interaction between `django-graphiql-debug-toolbar` and `django-debug-toolbar`, potentially due to version mismatches or an unusual configuration that leads to an uninitialized object.","error":"AttributeError: 'NoneType' object has no attribute 'enabled_panels'"}]}