[Grok-dev] megrok.chameleon and (custom) template namespaces

Jan-Wijbrand Kolman janwijbrand at gmail.com
Mon Apr 18 06:01:08 EDT 2011

On 4/18/11 11:10 , Jan-Jaap Driessen wrote:
> In a default grokproject installation (with 'classic'
> zope.pagetemplate, no chameleon) I see that page templates are always
> reloaded, no matter whether I use the deploy.ini or debug.ini
> configuration:
> http://zope3.pov.lt/trac/browser/zope.pagetemplate/trunk/src/zope/pagetemplate/pagetemplatefile.py#L91
> The developers of z3c.pt must have seen the same issue. The changelog [1] says:
> """Make debug mode setting explicit in a config.py. Currently it is
> bound to Python's __debug__, which is False when run with -O and
> otherwise True."""
> I remember that reloading of page templates was once tied to the
> developermode in zope.app.appsetup. Or do I remember incorrectly?

This is one of these things that is very surprising to me: I always 
thought and assumed and apparently never double-checked, that templates 
are only reloaded when zope is running in "devmode on".

This is indeed not the case: whenever `__debug__` is True, the template 
is reloaded.

Do people actually run their serves with `python -O` (which would make 
`__debug__` False, but also would make assert statements to be skipped)?

regards, jw

More information about the Grok-dev mailing list