Skip to content

ventorvar/django-graphiql-debug-toolbar

 
 

Repository files navigation

Django GraphiQL Debug Toolbar

Pypi Build Status Codecov

Django Debug Toolbar for GraphiQL IDE

https://user-images.githubusercontent.com/5514990/36340937-1937ee68-1419-11e8-8477-40622e98c312.gif

Dependencies

  • Python ≥ 3.4
  • Django ≥ 1.11

Installation

Install last stable version from Pypi.

pip install django-graphiql-debug-toolbar

See the documentation for further guidance on setting Django Debug Toolbar.

Add graphiql_debug_toolbar to your INSTALLED_APPS settings:

INSTALLED_APPS = [
    ...
    'debug_toolbar',
    'graphiql_debug_toolbar',
]

Replace the Django Debug Toolbar middleware with the GraphiQL Debug Toolbar one.

MIDDLEWARE = [
    ...
    # 'debug_toolbar.middleware.DebugToolbarMiddleware',
    'graphiql_debug_toolbar.middleware.DebugToolbarMiddleware',
    ...
]

The Debug Toolbar is shown only if your IP is listed in the INTERNAL_IPS setting (you can change this logic with the SHOW_TOOLBAR_CALLBACK option).

INTERNAL_IPS = ['127.0.0.1', '...']

Dockerize INTERNAL_IPS

import socket

hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS += [ip[:-1] + '1' for ip in ips]

Limitations

Panels rendering is not supported in multiprocess environment.


Credits to @jazzband / django-debug-toolbar.

About

Django Debug Toolbar for GraphiQL IDE and Graphene

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 76.1%
  • JavaScript 17.5%
  • Makefile 4.2%
  • HTML 2.2%