summary of the progress on the integration of CubicWeb with pyramid debugtoolbar

Laurent Peuch cortex at
Thu Sep 26 08:48:43 CEST 2019

Hello everyone,

During the previous weeks/months I've been working on improving debug
capacities and easiness of development within CubicWeb. I've already
shown a good part of my work/exploration during a Friday talk, you can
find the slides here
(the recording of the talk sadly failed :/)

In the mean time I've made a lot of progress on integrating with the
pyramid debugtoolbar.

By default the toolbar isn't very interesting appart from an
integrated stacktrace debug page activated on a exception: there
integrated pdb like debug shell (like "you can use a python/pdb shell at
every frame of the stack to debug things") than can save you **a lot**
of time. Illustration:

So, here is the list of panels I've came up with, in order of

Not the most interesting one: a general information panel with not
that much information
(it wasn't a priority as there is already /siteinfo)

Much more interesting but still a bit experimental: a hierarchy of
class used for rendering the current page with their key in the
For now the mechanism to get the parent class is still experimental
(and a bit hackish) so it doesn't succeed all the time.

A list of all decisions taken by the registries for rendering a page
with the weight of all candidates and the arguments used to take this

A bit like in /siteinfo but with more information, the content of the

Like show in the talk but enhanced with syntax highlight and the SQL
queries generated by the RQL query, the RQL panel
witch also include a traceback for every query

In the same fashion, the SQL panel (with parent RQL queries) and also
a traceback

And last one, a panel for the called hooks
This one is a bit special because hooks only happen on POST requests
(and during startup/shutdown of the server) and CW only show pages on
a GET request (which never triggers hooks), so the called hooks in
this panel are ALL the hooks called during your current session.

And the additional feature for *all* panel: whenever you click on the
"<>" next to an object/class on a panel and one every file path in a
call stack you'll be able to see the source file containing the class
definition of the line of the call stack :
(for security reason only white listed files are accessible)

Of course, all of this only activate itself on the pyramid dev server
when the debug mode ("-D") is activated and the pyramid debugtoolbar
is installed.

All this work is available on my repository (well except the last
"link to files in the traceback" stuff that I need to clean) (there are also various
other debugging improvement that you can find here that I haven't
listed in the email nor during the talk.)

With some luck we'll see those or another form of those in the next

Have a nice day :)


Laurent Peuch -- Bram

More information about the cubicweb-devel mailing list