Since I struggled with that lately, too, I appreciate all kind of improvement, although I now know my way around :D
My 2 cents atm: Why is it strictly required for @expose to know about the renderers? Couldn't that be done more lazy when they are first used? For init_config, there was one thing that helped me a lot after having no success, and we should definitely document it somewhere: In any hook, or in after_init_config, or really anywhere, it can be very helpful to import tg.config as tgconf in the scope of the function and not globally in app_cfg.py! Am Freitag, 12. Juli 2013 12:19:02 UTC+2 schrieb [email protected]: > > Just writing to get some feedbacks. > It looks to me that the configuration process in TG2 is the framework part > that requires most improvements. Some of its complexity is due to the need > to cope with Pylons, PasteDeploy and TG options. > > The first issue that bothers me is how @expose and AppConfig.renderers > interact. The first requires renderers to be in place to check if the > exposed template engines are available. This forces users to create > AppConfig before importing or declaring any controller. Otherwise renderers > detection gets totally disabled. This is not much of an issue usually, as > the quickstart is organized that way, but is pretty obvious when using > minimal mode. > > The other issue is the complexity derived from how init_config works. > It is not clear when options get available or where the user is supposed > to set custom options. > Some options have precedence when set in AppConfig, while other have > precedence when set in .ini also the after_init_config hook is not > explicitly suggested to extend configuration with custom options. > > Any idea on how to tackle those? The most simple solution would be to > leave the current behavior but at least notify the user: Raising an > exception if no renderers are available when declaring/importing the > controller telling the user to do it after setting up the configuration and > explicitly stating the after_init_config is the place where to add custom > configuration options. > -- You received this message because you are subscribed to the Google Groups "TurboGears Trunk" 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 http://groups.google.com/group/turbogears-trunk. For more options, visit https://groups.google.com/groups/opt_out.
