django-debug-toolbar 安装及配置 django性能监控及调试

安装:

pip install django-debug-toolbar

配置:

    settings 配置

  

DEBUG = True

INSTALLED_APPS = [
   
    'debug_toolbar'

]
MIDDLEWARE = [
    'debug_toolbar.middleware.DebugToolbarMiddleware',
 
]

INTERNAL_IPS = ("192.168.1.222",)

DEBUG_TOOLBAR_PANELS = [
    'debug_toolbar.panels.versions.VersionsPanel',
    'debug_toolbar.panels.timer.TimerPanel',
    'debug_toolbar.panels.settings.SettingsPanel',
    'debug_toolbar.panels.headers.HeadersPanel',
    'debug_toolbar.panels.request.RequestPanel',
    'debug_toolbar.panels.sql.SQLPanel',
    'debug_toolbar.panels.staticfiles.StaticFilesPanel',
    'debug_toolbar.panels.templates.TemplatesPanel',
    'debug_toolbar.panels.cache.CachePanel',
    'debug_toolbar.panels.signals.SignalsPanel',
    'debug_toolbar.panels.logging.LoggingPanel',
    'debug_toolbar.panels.redirects.RedirectsPanel',
]

urls 配置:

import debug_toolbar

urlpatterns = [
    url(r'^admin/', admin.site.urls),

    url(r'^__debug__/', include(debug_toolbar.urls)),

]

 

上一篇:android – 软键盘将工具栏推入顶部状态栏


下一篇:android – 工具栏默认样式和导航图标