goodconf icon indicating copy to clipboard operation
goodconf copied to clipboard

Support `env_prefix`

Open lyz-code opened this issue 3 years ago • 0 comments

Hi, I'm trying to use the BaseSettings env_prefix Config property to preprend a string on the environment variables without success. A simple snippet that shows the desired behaviour is:

import os

from goodconf import GoodConf


class AppConfig(GoodConf):
    "Configuration for My App"
    DEBUG: bool = False

    class Config:
        env_previx = "GOOD_"


os.environ["GOOD_DEBUG"] = "True"

config = AppConfig(load=True)

assert config.DEBUG

Using os.environ['DEBUG'] = "True" works though

lyz-code avatar Dec 14 '21 16:12 lyz-code