Skip to content
Browse files

add images

  • Loading branch information...
1 parent 0bf3140 commit fe37e170333008b18c9fb20ab4a044e45c22dc07 @mcdonc mcdonc committed
View
39 docs/api.rst
@@ -5,3 +5,42 @@
.. automodule:: pyramid_debugtoolbar
+.. autofunction:: includeme
+
+.. automodule:: pyramid_debugtoolbar.panels.sqla
+
+.. autoclass:: SQLADebugPanel
+
+.. automodule:: pyramid_debugtoolbar.panels.versions
+
+.. autoclass:: VersionDebugPanel
+
+.. automodule:: pyramid_debugtoolbar.panels.settings
+
+.. autoclass:: SettingsDebugPanel
+
+.. automodule:: pyramid_debugtoolbar.panels.routes
+
+.. autoclass:: RoutesDebugPanel
+
+.. automodule:: pyramid_debugtoolbar.panels.request_vars
+
+.. autoclass:: RequestVarsDebugPanel
+
+.. automodule:: pyramid_debugtoolbar.panels.renderings
+
+.. autoclass:: RenderingsDebugPanel
+
+.. automodule:: pyramid_debugtoolbar.panels.performance
+
+.. autoclass:: PerformanceDebugPanel
+
+.. automodule:: pyramid_debugtoolbar.panels.logger
+
+.. autoclass:: LoggingPanel
+
+.. automodule:: pyramid_debugtoolbar.panels.headers
+
+.. autoclass:: HeaderDebugPanel
+
+
View
BIN docs/exc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN docs/headers.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
66 docs/index.rst
@@ -4,12 +4,12 @@ pyramid_debugtoolbar
Overview
--------
-``pyramid_debugtoolbar`` provides a debug toolbar useful while you're
+:mod:`pyramid_debugtoolbar` provides a debug toolbar useful while you're
developing a :term:`Pyramid` application.
-Note that :mod:`pyramid_debugtoolbar` is a blatant rip-off of Michael van
-Tellingen's ``flask-debugtoolbar`` (which itself was ripped off from Rob
-Hudson's ``django-debugtoolbar``).
+:mod:`pyramid_debugtoolbar` is a blatant rip-off of Michael van Tellingen's
+``flask-debugtoolbar`` (which itself was derived from Rob Hudson's
+``django-debugtoolbar``).
.. warning:: This package only works with Pyramid 1.1.1 and above. As of
this writing, Pyramid 1.1.1 has not yet been released, which effectively
@@ -26,31 +26,39 @@ Install using setuptools, e.g. (within a virtualenv)::
Setup
-----
-Once ``pyramid_debugtoolbar`` is installed, you must use the
+Once :mod:`pyramid_debugtoolbar` is installed, you must use the
``config.include`` mechanism to include it into your Pyramid project's
configuration. In your Pyramid project's ``__init__.py``:
.. code-block:: python
- :linenos:
config = Configurator(.....)
config.include('pyramid_debugtoolbar')
-From now on, whenever an HTML response is generated by Pyramid, it will
-include the debug toolbar as a floating element on right hand side of the
-page. Additionally:
+Alternately, instead of using the Configurator's ``include`` method, you can
+activate Pyramid by changing your application's ``.ini`` file, use the
+following line:
-- when an exception is raised by your application, an interactive debugging
- console will appear.
+.. code-block:: ini
-- when a redirect is issued by your application, you will be given the choice
- to examine the state of the redirect page.
+ pyramid.includes = pyramid_debugtoolbar
.. warning:: The debug toolbar should never be enabled in a production
environment or on a machine with its Pyramid HTTP port exposed directly to
the internet; it allows arbitrary code execution from only semi-trusted
sources when configured poorly.
+Once the application is restarted, whenever an HTML response is generated by
+Pyramid, it will include the debug toolbar as a floating element on right
+hand side of the page. Additionally:
+
+- when an exception is raised by your application, an interactive debugging
+ console will appear.
+
+- when a redirect is issued by your application, you will be given the choice
+ to examine the state of the redirect page before proceeding to the redirect
+ target page.
+
The Toolbar
-----------
@@ -74,35 +82,48 @@ Versions
Displays versions of all installed Python software as well as the Python
version and platform itself.
+.. image:: versions.png
+
Settings
~~~~~~~~
Displays Pyramid deployment settings (aka ``registry.settings``).
+.. image:: settings.png
+
HTTP Headers
~~~~~~~~~~~~
Displays HTTP request and response headers for the current page.
+.. image:: headers.png
+
Request Vars
~~~~~~~~~~~~
Displays objects attached to the request of the current page.
+.. image:: requestvars.png
+
Renderings
~~~~~~~~~~
Displays the renderings performed by Pyramid for the current page.
+.. image:: renderings.png
+
Logging
~~~~~~~
Displays messages logged by the current page.
+.. image:: logging.png
+
Performance
~~~~~~~~~~~
-Displays timing information, and, if enabled, Python profiling information for the current page.
+Displays timing information, and, if enabled, Python profiling information
+for the current page.
.. image:: performance.png
@@ -111,12 +132,16 @@ Routes
Displays the routes currently configured in your application.
+.. image:: routes.png
+
SQLAlchemy
~~~~~~~~~~
Displays SQL queries made by SQLAlchemy by the current page along with timing
information.
+.. image:: sqla.png
+
Exceptions
----------
@@ -124,7 +149,9 @@ When an exception is raised, Pyramid presents a debugging page:
.. image:: exc.png
-You can examine locals in each frame in the traceback.
+You can examine locals in each frame in the traceback and execute code in the
+context of each frame. Read the instructions on the exception handling page
+for more information.
Settings
--------
@@ -153,14 +180,17 @@ Pyramid ``.ini`` file within the Pyramid "app" section).
``debugtoolbar.intercept_redirects``
- ``true`` if the redirection handler is enabled; ``false`` if the
- handler is disabled. Default: ``true``. This differs from
+ ``true`` if the redirection handler is enabled; ``false`` if the handler
+ is disabled. Default: ``true``. This differs from
``debugtoolbar.enabled``: it only disables the redirection handler.
``debugtoolbar.panels``
A list of dotted Python global names to panel classes. Defaults to a
- list of all panel types known by ``pyramid_debugtoolbar``.
+ list of all panel types known by :mod:`pyramid_debugtoolbar`, as
+ documented in :ref:`pyramid_debugtoolbar_api`. If this is spelled in an
+ ``.ini`` file, it should be a linefeed-separated sequence of dotted
+ Python names.
More Information
----------------
View
BIN docs/logging.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN docs/performance.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN docs/renderings.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN docs/requestvars.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN docs/routes.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN docs/settings.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN docs/sqla.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN docs/toolbar-closed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN docs/toolbar-open.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN docs/versions.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
3 pyramid_debugtoolbar/__init__.py
@@ -39,6 +39,9 @@ def populate(name, convert, default):
return parsed
def includeme(config):
+ """ Activate the debug toolbar; usually called via
+ ``config.include('pyramid_debugtoolbar')`` instead of being invoked
+ directly. """
settings = parse_settings(config.registry.settings)
config.registry.settings.update(settings)
config.include('pyramid_jinja2')
View
2 pyramid_debugtoolbar/panels/headers.py
@@ -5,7 +5,7 @@
class HeaderDebugPanel(DebugPanel):
"""
- A panel to display HTTP headers.
+ A panel to display HTTP request and response headers.
"""
name = 'Header'
has_content = True
View
2 pyramid_debugtoolbar/panels/performance.py
@@ -19,7 +19,7 @@
class PerformanceDebugPanel(DebugPanel):
"""
- Panel that looks at the performance of requests.
+ Panel that looks at the performance of a request.
It will display the time a request took and, optionally, the
cProfile output.
View
3 pyramid_debugtoolbar/panels/renderings.py
@@ -4,7 +4,8 @@
class RenderingsDebugPanel(DebugPanel):
"""
- Panel that displays the renderers used during the request.
+ Panel that displays the renderers (templates and 'static' renderers such
+ as JSON) used during a request.
"""
name = 'Template'
has_content = True
View
3 pyramid_debugtoolbar/panels/request_vars.py
@@ -4,7 +4,8 @@
class RequestVarsDebugPanel(DebugPanel):
"""
- A panel to display request variables (POST/GET, session, cookies).
+ A panel to display request variables (POST/GET, session, cookies, and
+ ad-hoc request attributes).
"""
name = 'RequestVars'
has_content = True
View
2 pyramid_debugtoolbar/panels/routes.py
@@ -12,7 +12,7 @@
class RoutesDebugPanel(DebugPanel):
"""
- A panel to display application routes.
+ A panel to display the routes used by your Pyramid application.
"""
name = 'Routes'
has_content = True
View
3 pyramid_debugtoolbar/panels/settings.py
@@ -7,7 +7,8 @@
class SettingsDebugPanel(DebugPanel):
"""
- A panel to display application settings.
+ A panel to display Pyramid deployment settings for your application (the
+ values in ``registry.settings``).
"""
name = 'Settings'
has_content = True
View
3 pyramid_debugtoolbar/panels/sqla.py
@@ -33,7 +33,8 @@ def _after_cursor_execute(conn, cursor, stmt, params, context, execmany):
class SQLADebugPanel(DebugPanel):
"""
- Panel that displays the time a response took in milliseconds.
+ Panel that displays the SQL generated by SQLAlchemy plus the time each
+ SQL statement took in milliseconds.
"""
name = 'SQLAlchemy'
has_content = has_sqla
View
3 pyramid_debugtoolbar/panels/versions.py
@@ -22,7 +22,8 @@
class VersionDebugPanel(DebugPanel):
"""
- Panel that displays the Pyramid version.
+ Panel that displays the Python version, the Pyramid version, and the
+ versions of other software on your PYTHONPATH.
"""
name = 'Version'
has_content = True

0 comments on commit fe37e17

Please sign in to comment.
Something went wrong with that request. Please try again.