Cannot Get Django-debug-toolbar To Appear
Answer :
I had the same problem but managed to fix it following dvl's comment on this page. Here is a summary of the fix:
In settings.py
if DEBUG: MIDDLEWARE += ( 'debug_toolbar.middleware.DebugToolbarMiddleware', ) INSTALLED_APPS += ( 'debug_toolbar', ) INTERNAL_IPS = ('127.0.0.1', ) DEBUG_TOOLBAR_CONFIG = { 'INTERCEPT_REDIRECTS': False, }
In the project urls.py, add this url pattern to the end:
from django.conf import settings if settings.DEBUG: import debug_toolbar urlpatterns += [ url(r'^__debug__/', include(debug_toolbar.urls)), ]
Some information for news users as me, when dev on virtual or remote machine
Add this ligne in a views.py file
print("IP Address for debug-toolbar: " + request.META['REMOTE_ADDR'])
When the views is call, you can see the client IP in the shell
You have to add this IP the settings.py file INTERNAL_IPS = ('IP')
All of the divs with display: none;
are in fact behaving properly. They won't change to display: block;
until you actually click on them in the toolbar itself.
The button used to toggle the toolbar is the div with an id="djDebugToolbarHandle"
. As you can see in your console, this button has a top
position of 2310px
. What this means is that it is rendering, but it is just way down off the page.
Try typing the following in the console to reset its position:
document.getElementById('djDebugToolbarHandle').style.top="30px";
Comments
Post a Comment