[Zope3-Users] How can I determine (in code) if the instance
isrunning in devmode or not?
Andreas Johnsen
andreas.johnsen at bouvet.no
Fri May 30 06:18:52 EDT 2008
Thanks!
> -----Original Message-----
> From: zope3-users-bounces at zope.org
> [mailto:zope3-users-bounces at zope.org] On Behalf Of Marius Gedminas
> Sent: 30. mai 2008 12:12
> To: zope3-users at zope.org
> Subject: Re: [Zope3-Users] How can I determine (in code) if
> the instance isrunning in devmode or not?
>
> On Wed, May 28, 2008 at 04:45:13PM +0200, Andreas Johnsen wrote:
> > I want to insert some extra HTML from a viewlet manager
> when running
> > in devmode. How can I determine (in code) if the instance
> is running
> > in devmode or not?
>
> from zope.app.appsetup.appsetup import getConfigContext
>
> def is_devmode_enabled():
> """Is devmode enabled in zope.conf?"""
> config_context = getConfigContext()
> return config_context.hasFeature('devmode')
>
> Regards,
> Marius Gedminas
> --
> "Don't trust a statistic you haven't faked yourself."
> -- Seen in another posting by Markus Kuhn
>
More information about the Zope3-users
mailing list