Does anybody know how to configure the default variant in TurboGears?
I'd like to have the debug variant in my development environment, and
the packed variant in my production environment.
-- Christoph
There is no config-file-way for now, partially because TW lacks an
option in the make_middleware-call, partially because TG2 doesn't
propagate configuration settings in the AppConfig-class.
So IMHO the easiest way is to set this value inside config.middleware
like this:
import tw.api
tw.api.resources.registry.ACTIVE_VARIANT =
app_conf.get("tw.resource_variant",
tw.api.resource.registry.DEFAULT_VARIANT)
Regards,
Diez
Thanks Diez, that works. I wonder whether we should add this to the
default quickstart template, together with appropriate settings of
tw.resource_variant in development.ini and depolyment.ini?
-- Christoph
Most certainly yes. I also would like to see that AppConf actually passes down
app_conf to the tw.api.make_middleware-call. Thus other config-options could
be set, e.g. require_once, serve_resources and so on.
Diez
Good idea. I've created ticket #2439 for this now.
-- Christoph