Introducing Flask Debug Toolbar
Display useful information for debugging.
This commit is contained in:
@@ -712,6 +712,10 @@ class PillarServer(BlinkerCompatibleEve):
|
|||||||
|
|
||||||
authentication.setup_app(self)
|
authentication.setup_app(self)
|
||||||
|
|
||||||
|
# Register Flask Debug Toolbar (disabled by default).
|
||||||
|
from flask_debugtoolbar import DebugToolbarExtension
|
||||||
|
DebugToolbarExtension(self)
|
||||||
|
|
||||||
for ext in self.pillar_extensions.values():
|
for ext in self.pillar_extensions.values():
|
||||||
self.log.info('Setting up extension %s', ext.name)
|
self.log.info('Setting up extension %s', ext.name)
|
||||||
ext.setup_app(self)
|
ext.setup_app(self)
|
||||||
@@ -722,6 +726,7 @@ class PillarServer(BlinkerCompatibleEve):
|
|||||||
self._config_user_caps()
|
self._config_user_caps()
|
||||||
|
|
||||||
# Only enable this when debugging.
|
# Only enable this when debugging.
|
||||||
|
# TODO(fsiddi): Consider removing this in favor of the routes tab in Flask Debug Toolbar.
|
||||||
# self._list_routes()
|
# self._list_routes()
|
||||||
|
|
||||||
def setup_db_indices(self):
|
def setup_db_indices(self):
|
||||||
|
@@ -270,3 +270,14 @@ STATIC_FILE_HASH = ''
|
|||||||
# all API endpoints do not need it. On the views that require it, we use the
|
# all API endpoints do not need it. On the views that require it, we use the
|
||||||
# current_app.csrf.protect() method.
|
# current_app.csrf.protect() method.
|
||||||
WTF_CSRF_CHECK_DEFAULT = False
|
WTF_CSRF_CHECK_DEFAULT = False
|
||||||
|
|
||||||
|
# Flask Debug Toolbar. Enable it by overriding DEBUG_TB_ENABLED in config_local.py.
|
||||||
|
DEBUG_TB_ENABLED = False
|
||||||
|
DEBUG_TB_PANELS = [
|
||||||
|
'flask_debugtoolbar.panels.versions.VersionDebugPanel',
|
||||||
|
'flask_debugtoolbar.panels.headers.HeaderDebugPanel',
|
||||||
|
'flask_debugtoolbar.panels.request_vars.RequestVarsDebugPanel',
|
||||||
|
'flask_debugtoolbar.panels.config_vars.ConfigVarsDebugPanel',
|
||||||
|
'flask_debugtoolbar.panels.template.TemplateDebugPanel',
|
||||||
|
'flask_debugtoolbar.panels.logger.LoggingPanel',
|
||||||
|
'flask_debugtoolbar.panels.route_list.RouteListDebugPanel']
|
||||||
|
@@ -14,6 +14,7 @@ Eve==0.8
|
|||||||
Flask==1.0.2
|
Flask==1.0.2
|
||||||
Flask-Babel==0.11.2
|
Flask-Babel==0.11.2
|
||||||
Flask-Caching==1.4.0
|
Flask-Caching==1.4.0
|
||||||
|
Flask-DebugToolbar==0.10.1
|
||||||
Flask-Script==2.0.6
|
Flask-Script==2.0.6
|
||||||
Flask-Login==0.4.1
|
Flask-Login==0.4.1
|
||||||
Flask-WTF==0.14.2
|
Flask-WTF==0.14.2
|
||||||
|
Reference in New Issue
Block a user