Personal tools
You are here: Home Documentation Tutorials Best Practices for Plone development Debugging Plone
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

Debugging Plone

Life without debuggers is hard. Here's what you need to know to get a better life.

Joel Burton

Based on the talk given by Joel Burton at the Plone Conference in Vienna, this Tutorial discusses some of the best practices for Plone development. If you are doing site development with Plone and want to keep your sanity, this is a must-read. Requires some familiarity with Zope and Plone.
Page 6 of 9.

Debugging

(For a more thorough example of working in the debugger, see Using PDB)

  • Life without debuggers isn't worth living
    • Simple problems get solved in 2 minutes
    • Complicated problems are possible to solve

The Debugger is Your Friend

  • Using debugger with ZEO in Zope 2.7

    zopectl debug will enter the debugger under ZEO.

  • Can examine anything
  • Can execute arbitrary code, change variables, change ZODB

Executing Requests

  • Zope.debug(...)
    • Read documentation on debug with Zope
    • , u="user:password"
    • , pm=1 for postmortem

Playing in the ZODB

Often, even more helpful than debugging is the ability to simple examine your ZODB directly outside of any request or debug-stepping. Once you're used to this, you'll probably find you keep the debugger open all the time while you're developing and debugging, just to quickly see how things are actually created and working in Zope.

  • Most useful feature
  • Can interactively examine and change ZODB outside of debugging
  • The root of ZODB is app

ZODB Changes

  • To commit your transaction: get_transaction().commit()
  • To sync yourself to the current ZODB: app._p_jar.sync()

Graphical Debuggers

  • BoaConstructor
    • Can debug ZODB Python Scripts
    • Can build Zope objects
  • WingIDE
    • Powerful remote debugging
    • Can debug FS-stored Python Scripts
  • Komodo
    • Regex debugging
    • Excellent IDE
 
by Joel Burton last modified June 8, 2006 - 00:02 All content is copyright Plone Foundation and the individual contributors.

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by