If I correctly understood what you are trying to do, it's pretty much the same that tgext.evolve does while running "evolutions". tgext.evolve is an extension to run upgrade scripts that need a downtime of the system. While the evolutions are running the system is put in "maintenance mode" and is recovered once the evolutions completed.
This is handled by an application wrapper -> https://github.com/axant/tgext.evolve/blob/master/tgext/evolve/__init__.py#L66 Application wrappers are a TG specific middleware that can be injected through the request execution pipeline to change its behaviour. See http://turbogears.readthedocs.io/en/latest/turbogears/hooks.html#application-wrappers for details. Inside an application wrapper you can for example change the path of the served page and send user somewhere else, that is for example what the Custom Error Pages application wrapper provided by TG itself does -> https://github.com/TurboGears/tg2/blob/development/tg/appwrappers/errorpage.py#L87-L90 On Thu, May 25, 2017 at 1:29 AM, D R Dinesh Kumar <[email protected]> wrote: > Hi. > > We would like to manage ShutDown situation for our application where we > would like to divert all calls to the app to default/shutdown.html page > when 'ShutDown' is enabled in .ini file. > > For Ex: > in development.ini file > ------------------------------------ > app.shutdown = True > app.shutdown_msg = 'system is in maintenance' > > if this is setup, then start the tg from ShutDownController() instead of > RootController() > > where as in, my root.py has > '-------------------------------------------- > class ShutDown(BaseController): > expose(template="templates.shutdown") > def default(self,*lst, **kw): > msg = config.get('shutdown_msg','system is temporarity shutdown. > Sorry for the inconvenience') > return dict(msg = msg) > > class RootController(BaseController): > ... > ... > > This was handled during commands.py script in TG1 with Cherrypy. > > Is there any way to do the same in TG2? or is there any better way to > handle this scenario? > > With Regards, > Dinesh. > > -- > You received this message because you are subscribed to the Google Groups > "TurboGears" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/turbogears. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "TurboGears" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/turbogears. For more options, visit https://groups.google.com/d/optout.

