In talking to Bulat over the weekend, I've become distressed on figuring out the ideal configuration input.
What we have now is simple: A simple python file.
However, Bulat is strongly pushing for what he considers best practice (and is in fact described in 12-factor apps [1]) which is to just use environment variables.
I mostly agree with him, but I have these issues:
1) It will introduce string parsing. No more native types, it's all strings. Any Setting that's not a string will have to provide a means to parse it.
2) Configuration is no longer dynamic. No loading configuration from other configuration files, querying servers, or anything like that.
3) Environment for lots of configuration? Most of our apps to date have a fair amount of configuration. This means you'll be creating a bash script file anyway to set up your configuration.
It's also now a single flat namespace, no programming constructs to bring to configuration. Python files are also the favorite (not most popular) form of configuration in the Python world, perhaps we are all already biased. Django, Gunicorn, etc.
Okay, thoughts? Bulat, anything to add in favor of env vars?
--
Jeff Lindsay
http://progrium.com