<div class="gmail_quote">2009/4/23 TonyXu <span dir="ltr">&lt;<a href="mailto:txu@userful.com">txu@userful.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
so far, I put the code in a module outside the functions and classes, it can<br>
be run when the grok is started up. However, if I call &quot;grok.getSite()&quot; to<br>
get the application object, it return &quot;None&quot;. I guess it&#39;s because at the<br>
beginning of grok&#39;s stating up, the grok will load all the modules, so my<br>
code can be run, but at that time, the grok is not completely ready.<br>
so, where is the best place to put the code?</blockquote><div><br>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:<br>
<br><a href="http://exploring-grok.blogspot.com/2009/01/grok-configuration-phase-and-its.html">http://exploring-grok.blogspot.com/2009/01/grok-configuration-phase-and-its.html</a><br><br>Can you supply a bit of a summary of what you&#39;re trying to achieve exactly?<br>
</div></div><br>Thanks,<br>Paul<br>