Application Configuration
Application configuration can be accessed programmatically by importing lime_config
and calling the function get_app_config
:
Consider the following application config:
config:
foo: bar
nested:
deep: value
Example usage below:
import lime_config
# Just getting a value from a key
lime_config.get_app_config(my_app, 'config.foo') => 'bar'
lime_config.get_app_config(my_app.identifier, 'config.foo') => 'bar'
# Getting a nested value directly using dotted notation
lime_config.get_app_config(my_app, 'config.nested.deep') => 'value'
lime_config.get_app_config(my_app.identifier, 'config.nested.deep') => 'value'
# Getting a dict-like object and doing [key] on that
lime_config.get_app_config(my_app, 'config.nested')['deep'] => 'value'
lime_config.get_app_config(my_app.identifier, 'config.nested')['deep'] => 'value'