django-debug-toolbar not showing up

前端 未结 27 1654
谎友^
谎友^ 2020-11-30 20:12

I looked at other questions and can\'t figure it out...

I did the following to install django-debug-toolbar:

  1. pip install django-debug-toolbar
27条回答
  •  死守一世寂寞
    2020-11-30 20:53

    I tried the configuration from pydanny's cookiecutter-django and it worked for me:

    # django-debug-toolbar
    MIDDLEWARE_CLASSES = Common.MIDDLEWARE_CLASSES + ('debug_toolbar.middleware.DebugToolbarMiddleware',)
    INSTALLED_APPS += ('debug_toolbar',)
    
    INTERNAL_IPS = ('127.0.0.1',)
    
    DEBUG_TOOLBAR_CONFIG = {
        'DISABLE_PANELS': [
            'debug_toolbar.panels.redirects.RedirectsPanel',
        ],
        'SHOW_TEMPLATE_CONTEXT': True,
    }
    # end django-debug-toolbar
    

    I just modified it by adding 'debug_toolbar.apps.DebugToolbarConfig' instead of 'debug_toolbar' as mentioned in the official django-debug-toolbar docs, as I'm using Django 1.7.

提交回复
热议问题