[ckan-dev] pylons.app_globals vs pylons.config

Sean Hammond sean.hammond at okfn.org
Tue Apr 16 17:08:03 UTC 2013


Hey, something I think we need to nail down (and document in our dev
docs) is whether CKAN uses pylons.app_globals (also known as pylons.g)
or pylons.config for configuration settings. We should pick one and
stick to it.

The discussion started here:

https://github.com/okfn/ckan/pull/693#issuecomment-16233559

and I'm now moving it to the dev list.

What I want to achieve is having all our config options along with their
associated metadata (docstrings, default values, types) defined in one
place, and be able to use autodoc to pull the docstrings into sphinx.

I think Toby is interested in abstracting CKAN away from Pylons so that
we can move to another web framework one day.

Toby doesn't like pylons.config because you need to do asbool() and the
like and because it's not accessible from templates.

I'm not sure whether pylons.app_globals is the solution to this however,
if our aim is to abstract CKAN away from Pylons so that we can
eventually move to another web framework, then I'm not sure that moving
the config handling from one Pylons thing to another Pylons thing
really helps with that. But maybe it does?

Maybe we need to define our own CKAN class or module for handling the
config settings, that will for now be implemented as a wrapper around
pylons.config but could in the future wrap something else without
changing its own interface. Currently we seem to have sort of done that
as a wrapper around app_globals but that seems a bit odd to me.




More information about the ckan-dev mailing list