zoukankan      html  css  js  c++  java
  • Djano调试工具debug-toolbar

    Djano调试工具debug-toolbar

     

    django-debug-toolbar 调试工具使用文档

    安装

    
    
    pip install django-debug-toolbar

    配置

    settings.py文件中添加配置:

    
    
    INSTALLED_APPS = [
    # ...
    'django.contrib.staticfiles',
    # ...
    'debug_toolbar',
    ]

    STATIC_URL = '/static/'

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

    INTERNAL_IPS = [
    '127.0.0.1',
    ]

    # 添加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',
    ]

    urls.py中添加内容

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

    配置完成,启动项目即可。

    参考文档:官方文档

     
  • 相关阅读:
    Gerrit配置--用户配置
    repo+manifests+git方式管理安卓代码
    FLASH OTP
    Wireshark抓包分析TCP协议
    python 批量修改图片大小
    python 文件查找 glob
    python 统计单词个数
    python 图片上添加数字源代码
    python 删除文件和文件夹
    python 程序列表
  • 原文地址:https://www.cnblogs.com/xiao-xue-di/p/10460839.html
Copyright © 2011-2022 走看看