請摒棄簡單粗暴的PRint
--馬云
我比較習慣在windows中安裝pycharm開發,項目部署在虛擬機中,在本地瀏覽器中查看效果,這種方式在調試上會有點麻煩,django-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',]
最后的效果圖:

更多信息請:django debug toolbar官方文檔1.1版本 注意版本的兼容
新聞熱點
疑難解答