django-debug-toolbar

來源:互聯網
上載者:User

標籤:style   blog   http   io   檔案   2014   ar   代碼   

一:安裝django-debug-toolbar。

二:在settings裡的MIDDLEWARE_CLASSES加入‘debug_toolbar.middleware.DebugToolbarMiddleware‘一般是最後一行。

三:在settings裡的INSTALLED_APPS加入‘debug_toolbar‘

四:在settings裡加入INTERNAL_IPS = (‘127.0.0.1‘,)

:

django toolbar中顯示的項目可以通過修改設定檔來修改,在settings.py中增加如下代碼:

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‘,
)

我們可以把不想要的注釋掉

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.