1. 下载安装
源码在github上
https://github.com/django-debug-toolbar/django-debug-toolbar/
源码下载下来可以直接执行python setup.py install安装
2. Django配置
2.1 settings.py配置文件中添加APP debug_toolbar
2.2 添加中间件
debug_toolbar.middleware.DebugToolbarMiddleware
2.3 配置内部IP
在Settings.py文件中声明变量如下
INTERNAL_IPS = ('127.0.0.1',)
2.4 Panel注册
DEBUG_TOOLBAR_PANELS = ( 'debug_toolbar.panels.version.VersionDebugPanel', 'debug_toolbar.panels.timer.TimerDebugPanel', 'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel', 'debug_toolbar.panels.headers.HeaderDebugPanel', 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel', 'debug_toolbar.panels.template.TemplateDebugPanel', 'debug_toolbar.panels.sql.SQLDebugPanel', 'debug_toolbar.panels.signals.SignalDebugPanel', 'debug_toolbar.panels.logger.LoggingPanel', )