Changeset - 908e186abd8d
[Not reviewed]
default
0 2 0
Thomas De Schampheleire - 9 years ago 2017-01-28 20:46:00
thomas.de.schampheleire@gmail.com
backend: add TurboGears2 DebugBar support

DebugBar is a toolbar overlayed over the Kallithea web interface, allowing
you to see:

* timing information of the current request, including profiling information
* request data, including GET data, POST data, cookies, headers and
environment variables
* a list of executed database queries, including timing and result values

Enable it automatically when in debug mode and all requirements are met.
Add documentation.
2 files changed with 35 insertions and 0 deletions:
0 comments (0 inline, 0 general)
docs/contributing.rst
Show inline comments
 
@@ -204,6 +204,25 @@ code needs the database to assign an "au
 
a freshly created model object (before flushing, the ID attribute will
 
be ``None``).
 

	
 
TurboGears2 DebugBar
 
^^^^^^^^^^^^^^^^^^^^
 

	
 
It is possible to enable the TurboGears2-provided DebugBar_, a toolbar overlayed
 
over the Kallithea web interface, allowing you to see:
 

	
 
* timing information of the current request, including profiling information
 
* request data, including GET data, POST data, cookies, headers and environment
 
  variables
 
* a list of executed database queries, including timing and result values
 

	
 
DebugBar is only activated when ``debug = true`` is set in the configuration
 
file. This is important, because the DebugBar toolbar will be visible for all
 
users, and allow them to see information they should not be allowed to see. Like
 
is anyway the case for ``debug = true``, do not use this in production!
 

	
 
To enable DebugBar, install ``tgext.debugbar`` and ``kajiki`` (typically via
 
``pip``) and restart Kallithea (in debug mode).
 

	
 

	
 
"Roadmap"
 
---------
 
@@ -225,3 +244,4 @@ Thank you for your contribution!
 
.. _kallithea-general: http://lists.sfconservancy.org/mailman/listinfo/kallithea-general
 
.. _Hosted Weblate: https://hosted.weblate.org/projects/kallithea/kallithea/
 
.. _wiki: https://bitbucket.org/conservancy/kallithea/wiki/Home
 
.. _DebugBar: https://github.com/TurboGears/tgext.debugbar
kallithea/config/app_cfg.py
Show inline comments
 
@@ -96,6 +96,21 @@ base_config = KallitheaAppConfig()
 
# TODO still needed as long as we use pylonslib
 
sys.modules['pylons'] = tg
 

	
 
# DebugBar, a debug toolbar for TurboGears2.
 
# (https://github.com/TurboGears/tgext.debugbar)
 
# To enable it, install 'tgext.debugbar' and 'kajiki', and run Kallithea with
 
# 'debug = true' (not in production!)
 
# See the Kallithea documentation for more information.
 
try:
 
    from tgext.debugbar import enable_debugbar
 
    import kajiki # only to check its existence
 
except ImportError:
 
    pass
 
else:
 
    base_config['renderers'].append('kajiki')
 
    enable_debugbar(base_config)
 

	
 

	
 
def setup_configuration(app):
 
    config = app.config
 

	
0 comments (0 inline, 0 general)