使用Django Debug Toolbar调试工具

安装方法: html

1.使用easy_install django-debug-toolbar安装django-debug-toolbar。 python

2.打开你项目的settings.py文件 sql

3.添加'debug_toolbar.middleware.DebugToolbarMiddleware'到项目的中间件中,MIDDLEWARE_CLASSES 内。 django

4.在settings.py中添加INTERNAL_IPS = ('127.0.0.1',),也能够设置外网地址。 spa

5.在INSTALLED_APPS 中添加'debug_toolbar' debug

6确保DEBUG选项为true code

7.添加DEBUG_TOOLBAR_PANELS选项 htm

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',  
  
)
原文地址: http://www.ehow.com/how_8735674_use-django-debug-toolbar.html
相关文章
相关标签/搜索