[Zope-dev] buildout + debugzope + wsgi
Baiju M
mbaiju at zeomega.com
Thu Jan 21 20:18:35 EST 2010
On Thu, Jan 21, 2010 at 11:47 PM, Adam GROSZER <agroszer at gmail.com> wrote:
> Hello,
>
> What do we use nowadays instead of the good old debugzope script
> with buildout and wsgi (and paster)?
> I somehow did not find a recipe for that.
Both Grok & BlueBream use zope.app.debug.debug to create
a debugger from database. And then create an interactive prompt,
like this:
db = zope.app.wsgi.config(zope_conf)
debugger = Debugger.fromDatabase(db)
# Invoke an interactive interpreter shell
banner = ("Welcome to the interactive debug prompt.\n"
"The 'root' variable contains the ZODB root folder.\n"
"The 'app' variable contains the Debugger,
'app.publish(path)' "
"simulates a request.")
__import__('code').interact(banner=banner,
local={'debugger': debugger,
'app': debugger,
'root': debugger.root()})
But, there is slight difference between invoking the prompt in Grok
and BlueBream. Grok has "[console_scripts]" entry point to create a
custom command and BlueBream use "[paste.global_paster_command]"
entry point to create sub-command for "paster".
BTW, BlueBream's idea is inspired by Pylons and code is stolen from Grok :)
Regards,
Baiju M
More information about the Zope-Dev
mailing list