N
N
Nick V2016-02-07 13:06:47
Django
Nick V, 2016-02-07 13:06:47

Setting up django 1.9 and django-debug-toolbar?

Hello. Installing django-debug-toolbar ran into an obscure problem. Help me to understand.
Debug toolbar is displayed only on the admin panel and on error pages. On pages that return 200, the toolbar does not appear.

admin.jpg

9a565d20c351439c972d83b4d2e6e4b7.jpg

404.jpg

eaf567f6609b42aca01fe7113ff19e23.jpg

200.jpg

e33cb6d23bf943ab85adf2a51b9a9a53.jpg

Debug Toolbar ==1.4
Django==1.9.2
Python==3.4.3
settings.py

DEBUG = True
ALLOWED_HOSTS = []

# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'myapp',
    'debug_toolbar',
]

MIDDLEWARE_CLASSES = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'debug_toolbar.middleware.DebugToolbarMiddleware',
]

INTERNAL_IPS = ('127.0.0.1', )

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nick V, 2016-02-07
@half-life

Found the answer on Stack Overflow:
The current stable version 0.11.0 requires the following things to be true for the toolbar to be shown:

  1. If you are serving static content make sure you collect the css, js and html by doing:
    ./manage.py collectstatic
    My mistake was that I wanted to quickly check the toolbar debug and there was only one line in the template<h1>Hello</h1>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question