Django开发调试工具Debug_Toolbar安装使用(mac+python3.5.3+django1.10.5)

环境

mac+python3.5.3+django1.10.5

安装

pip install django-debug-toolbar

配置

settings.py

INSTALLED_APPS = [
...
    'debug_toolbar',
]

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',
]

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

#setting末尾加上
INTERNAL_IPS = ('127.0.0.1','192.168.1.153',)

urls.py

if settings.DEBUG:
    import debug_toolbar
    urlpatterns += [url(r'^__debug__/', include(debug_toolbar.urls)),]

效果

参考

Django调试工具django-debug-toolbar安装使用教程
http://www.pythontab.com/html/2015/pythonweb_1012/964.html

Django 调试工具:Django Debug Toolbar
http://blog.csdn.net/xsj_blog/article/details/61622901

debug_toolbar的安装
http://blog.csdn.net/jklfjsdj79hiofo/article/details/8660640

[Django]跟着文档学Django-part4报错'polls' is not a registered namespace
http://blog.csdn.net/mwmoo/article/details/53783140

You may also like...

发表评论

电子邮件地址不会被公开。 必填项已用*标注