[Grok-dev] where to put the code that can be run automatically when groks are started up?

Paul Wilson paulalexwilson at gmail.com
Fri Apr 24 07:25:48 EDT 2009

2009/4/23 TonyXu <txu at userful.com>

> so far, I put the code in a module outside the functions and classes, it
> can
> be run when the grok is started up. However, if I call "grok.getSite()" to
> get the application object, it return "None". I guess it's because at the
> beginning of grok's stating up, the grok will load all the modules, so my
> code can be run, but at that time, the grok is not completely ready.
> so, where is the best place to put the code?

I had, when arriving a Grok, a similar issue I believe. Solving this issue
required me to understand the Grokking, Martian and ZCML configuration
stage. I wrote a large blog post surrounding my findings:


Can you supply a bit of a summary of what you're trying to achieve exactly?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/grok-dev/attachments/20090424/e109db77/attachment.html 

More information about the Grok-dev mailing list