File: debug-toolbar.md

package info (click to toggle)
strawberry-graphql-django 0.67.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,988 kB
  • sloc: python: 27,682; sh: 20; makefile: 20
file content (34 lines) | stat: -rw-r--r-- 920 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
title: Django Debug Toolbar
---

# django-debug-toolbar

This integration provides integration between the
[Django Debug Toolbar](https://github.com/jazzband/django-debug-toolbar) and
`strawberry`, allowing it to display stats like `SQL Queries`, `CPU Time`, `Cache Hits`, etc
for queries and mutations done inside the [graphiql page](https://github.com/graphql/graphiql).

To use it, make sure you have the
[Django Debug Toolbar](https://github.com/jazzband/django-debug-toolbar) installed
and configured, then change its middleware settings from:

```python title="settings.py"
MIDDLEWARE = [
    ...
    "debug_toolbar.middleware.DebugToolbarMiddleware",
    ...
]
```

To:

```python title="settings.py"
MIDDLEWARE = [
    ...
    "strawberry_django.middlewares.debug_toolbar.DebugToolbarMiddleware",
    ...
]
```

Finally, ensure app `"strawberry_django"` is added to your `INSTALLED_APPS` in Django settings.