Config files is located on configs/ dir at root of your project. Each environment config should be file with json content. Each json file = separate environment config
configs/
|--- production.json
|--- local.json
|--- stage.json
env file is located on root of your project. It needs to define your environment and load config file that belongs to your current environment
project_root
|--- .env
.env content:
production
DB connection configs will be parsed from .my.cnf file located on home directory
production.json:
{
"somevar": "111",
"somedict": {
"somevar": "222"
}
}
from configs import Config
configs = Config()
print(configs.get("somevar")) # 111
print(configs.get("somedict.somevar")) # 222
Released under MIT license