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

debug_toolbar panel not show. Help !!! #5

Closed eamigo86 closed 6 years ago

eamigo86 commented 6 years ago

Hi, thanks for this packages. I am interested in using this module in my developments, but I can not show the Debug-Toolbar bar. I follow your explication to setup it, but I can not do it.

# settings.py

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

MIDDLEWARE += [
     'graphiql_debug_toolbar.middleware.DebugToolbarMiddleware',, 
]

# add the the default debug-toolbars panels
DEBUG_TOOLBAR_PANELS = [
    .....
]
# urls.py
if settings.DEBUG:
    import debug_toolbar
    urlpatterns = [url(r'^__debug__/', include(debug_toolbar.urls)), ] + urlpatterns

I'm using Django 2.1 and python 3.6 I do not know if it has to do with the limitation of the package.

mongkok commented 6 years ago

@eamigo86 Hi and thanks! :)

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.) https://django-debug-toolbar.readthedocs.io/en/stable/installation.html#internal-ips

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

running docker containers...

import socket

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

Hi @mongkok and thanks. It works perfectly !!!!