Abandoned fork to turn Dozer into Pylons debug tool
JavaScript Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/inupy
.gitignore
HACKING.txt
LICENSE.txt
MANIFEST.in
NEWS.txt
README.rst
bootstrap.py
buildout.cfg
pylintrc
setup.py

README.rst

Inupy: fork/port of Dozer

inupy is meant to be a combination of the tools of Dozer into a single WSGI middleware providing a combined user panel. The tools are:

  • memory profiler
  • CPU profiler
  • capture of logging messages

Example screenshot of the control panel pop down:

http://lh3.ggpht.com/_MbJoFDKjoVk/TI1rVgf7xpI/AAAAAAAAAKY/8-jVptqp_Sk/s800/dozer_menu.png

Setup

You can enable inupy for your application by editing your WSGI factory function, or your PasteDeploy configuration file.

Option 1: add this to your development.ini (or whatever you call your PasteDeploy config file):

[filter-app:inupy]
use = egg:Inupy
# ... options ...
next = main
# assuming your main wsgi app is [app:main]

and then to use it, run paster serve development.ini -n inupy. If you do not specify the -n bit, inupy is disabled.

Option 2: change your development.ini like this:

[filter:inupy]
use = egg:Inupy
# ... options ...

[pipeline:main]
pipeline =
    inupy
    ...
    yourapp
# assuming your main wsgi app is [app:yourapp]

this way inupy is always availabe.

Option 3: edit your middleware.py (assuming a Pylons style project) like this:

import inupy

def make_app(...):
    ...
    if asbool(config['debug']):
        app = inupy.setup(app, config)
    app.config = config
    return app

this way it is enabled only if you have debug = true in your development.ini.

Configuration

Your application config should have options set for the various tools you wish to enable, e.g.

set inupy.profiler = true
set inupy.logview = true
set inupy.profile_path = /home/user/tmp/profiles
inupy.color.sqlalchemy = #faa
inupy.color.pylons.templating = #bfb

TODO: document them all

Goals and inspiration

Some goals are to embed a version of jQuery into its own namespace so it doesn't collide with the installed applications, but gives us some tools for some animations/etc.

Sane defaults: it should be sufficient to drop 'egg:Inupy' into a pipeline and have it Just Work. For performance reasons, "expensive" tools should be disabled by default, with the user able to turn them on at runtime.

Gorgeous look and feel like Django Debug Toolbar (one can dream...)

Credits