django debug toolbar 不顯示

NO IMAGE

python3.6 django2.0,安裝了django-debug-toolbar,根據官方文件配置之後卻沒看到除錯欄,

增加了SHOW_TOOLBAR_CALLBACK欄位後才顯示

settings檔案末尾:

if DEUBG:
# django debug toolbar
INSTALLED_APPS.append('debug_toolbar')
MIDDLEWARE.append('debug_toolbar.middleware.DebugToolbarMiddleware')
DEBUG_TOOLBAR_CONFIG = {
'JQUERY_URL': '//cdn.bootcss.com/jquery/2.1.4/jquery.min.js',
'SHOW_COLLAPSED': True,
'SHOW_TOOLBAR_CALLBACK': lambda x: True,
}

urls檔案新增:

from django.conf import settings
...
if settings.DEBUG:
# static and media
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns.extend(
staticfiles_urlpatterns()
static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
)
# debug toolbar
import debug_toolbar
urlpatterns.insert(0, path("__debug__/", include(debug_toolbar.urls)))