0

Can't see the Django Debug Toolbar on a simple html doc. New to Django and the tutorial i'm doing is a little outdated. I have done all the requirements such as ensure STATIC_URL = "static/", INSTALLED_APPS = ["django.contrib.staticfiles"], Backend and APP_DIRS is correct. debug_toolbar is in INSTALLED_APPS, added the added the debug url to urlpatterns list, Middleware is done and 'debug_toolbar.middleware.DebugToolbarMiddleware' is at the top. Internal IPS is set to 127.0.0.1, if i change it the ourcecode of the webpage removes the code for debug toolbar. Made sure that Debug = True

I use pycharm mostly, heard that might be an a problem using the runserver command so tried it on cmd as well. multiple times. when viewing the page source i see the code for the debug toolbar as well as my html.

thought maybe my html is written poorly(never used it before) this is what it looks like word for word.

<html>
    <head>
        <title>Example</title>
    </head>
    <body>
        <p>This is an example of a simple HTML page with one paragraph.</p>
    </body>
</html>

Latest version of django-debug-toolbar installed and django. Tried different chrome, edge and explorer browsers, all are the same. I've tried a few tricks like

def show_toolbar(request):
    return True
DEBUG_TOOLBAR_CONFIG = {
    "SHOW_TOOLBAR_CALLBACK" : show_toolbar,
}
DEBUG_TOOLBAR_CONFIG = {"SHOW_TOOLBAR_CALLBACK" : lambda x: True}

Someone suggested changing HKEY_CLASSES_ROOT.js\ because i'm on a windows 10.i haven't figured out how to do that yet

EDIT: this is the video i'm following along with

colk84
  • 92
  • 9
  • Add `{% load static %}` to your html file. I had a similar issue. Django Debug Toolbar uses this to load to load. – raphael Mar 11 '22 at 22:30
  • @raphael put it in line one and moved rest of the code down as well as tried it in last line, still nothing – colk84 Mar 11 '22 at 23:11
  • Do you also have a static folder within your app? – raphael Mar 12 '22 at 00:12
  • @raphael yup,2 located in django, 1 located in debug tool bar which has debug toolbar inside of it as well – colk84 Mar 12 '22 at 17:56
  • Not sure, I think I just went through the probably the same question you looked at [here](https://stackoverflow.com/questions/10517765/django-debug-toolbar-not-showing-up), and there was [something](https://stackoverflow.com/a/26473088/10951070) about *adding* `10.0.2.2` to your `INTERNAL_IPS`. – raphael Mar 12 '22 at 18:26
  • yeah i saw that question. still no go. setting it to ```10.0.2.2``` causes the web pages view source to only show the html i wrote without the debug toolbar stuff in it – colk84 Mar 12 '22 at 22:43

0 Answers0