Inverting The Order Of Environmental Variables In Configs
Playing with the idea of switching the heierarchy of environments and their variables in config files. For example, I'm doing this:
Code
}
Instead of this:
Code
}
It's an interesting experiment. It makes things more verbose though. First, there's a lot more lines in the config itself for the same info. Then, in the code, you can't simply do `config_data = config['dev']` to get an environment loaded. Each call has to have the env defined in it. For example:
Code
config = # Load the data
env = 'dev'
print(config.database_name[env])
instead of just being able to hit it with:
Code
config = # Load the data for just 'dev'
print(config.database_name)