We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
dynaconf.contrib.flask_dynaconf.DynaconfConfig to flask.config.Config
Hello, is there a way to convert a dynaconf.contrib.flask_dynaconf.DynaconfConfig object into a flask.config.Config one?
Otherwise, is there a way to convert dynaconf.contrib.flask_dynaconf.DynaconfConfig into a dict?

I have been struggling trying to pass a dynaconf.contrib.flask_dynaconf.DynaconfConfig to a Flask Cache constructor as a config. With flask.config.Config it works but with the dynaconf class it doesn't :-/.
 
cache = Cache().init_app(app, app.config)


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `dynaconf/default_settings.py`
Content:
```
1 import importlib
2 import os
3 import sys
4 import warnings
5 
6 from dynaconf.utils import raw_logger
7 from dynaconf.utils import RENAMED_VARS
8 from dynaconf.utils import warn_deprecations
9 from dynaconf.utils.files import find_file
10 from dynaconf.utils.parse_conf import parse_conf_data
11 
12 try:
13     from dotenv import load_dotenv
14 except ImportError:  # pragma: no cover
15     load_dotenv = lambda *args, **kwargs: None  # noqa
16 
17 
18 def try_renamed(key, value, older_key, current_key):
19     if value is None:
20         if key == current_key:
21             if older_key in os.environ:
22                 warnings.warn(
23                     "{0} is deprecated please use {1}".format(
24                         older_key, current_key
25                     ),
26                     DeprecationWarning,
27                 )
28                 value = os.environ[older_key]
29     return value
30 
31 
32 def get(key, default=None):
33     value = os.environ.get(key.upper())
34 
35     # compatibility with renamed variables
36     for old, new in RENAMED_VARS.items():
37         value = try_renamed(key, value, old, new)
38 
39     return (
40         parse_conf_data(value, tomlfy=True) if value is not None else default
41     )
42 
43 
44 def start_dotenv(obj=None, root_path=None):
45     # load_from_dotenv_if_installed
46     obj = obj or {}
47     _find_file = getattr(obj, "find_file", find_file)
48     root_path = (
49         root_path
50         or getattr(obj, "_root_path", None)
51         or get("ROOT_PATH_FOR_DYNACONF")
52     )
53     raw_logger().debug(
54         "Starting Dynaconf Dotenv %s",
55         "for {0}".format(root_path) if root_path else "Base",
56     )
57 
58     dotenv_path = (
59         obj.get("DOTENV_PATH_FOR_DYNACONF")
60         or get("DOTENV_PATH_FOR_DYNACONF")
61         or _find_file(".env", project_root=root_path)
62     )
63 
64     load_dotenv(
65         dotenv_path,
66         verbose=obj.get("DOTENV_VERBOSE_FOR_DYNACONF", False),
67         override=obj.get("DOTENV_OVERRIDE_FOR_DYNACONF", False),
68     )
69 
70     warn_deprecations(os.environ)
71 
72 
73 def reload(*args, **kwargs):
74     start_dotenv(*args, **kwargs)
75     importlib.reload(sys.modules[__name__])
76 
77 
78 # default proj root
79 # pragma: no cover
80 ROOT_PATH_FOR_DYNACONF = get("ROOT_PATH_FOR_DYNACONF", None)
81 
82 # Default settings file
83 default_paths = (
84     "settings.py,.secrets.py,"
85     "settings.toml,settings.tml,.secrets.toml,.secrets.tml,"
86     "settings.yaml,settings.yml,.secrets.yaml,.secrets.yml,"
87     "settings.ini,settings.conf,settings.properties,"
88     ".secrets.ini,.secrets.conf,.secrets.properties,"
89     "settings.json,.secrets.json"
90 )
91 SETTINGS_FILE_FOR_DYNACONF = get("SETTINGS_FILE_FOR_DYNACONF", default_paths)
92 
93 # # ENV SETTINGS
94 # # In dynaconf 1.0.0 `NAMESPACE` got renamed to `ENV`
95 
96 # The environment variable to switch current env
97 ENV_SWITCHER_FOR_DYNACONF = get(
98     "ENV_SWITCHER_FOR_DYNACONF", "ENV_FOR_DYNACONF"
99 )
100 
101 # The current env by default is DEVELOPMENT
102 # to switch is needed to `export ENV_FOR_DYNACONF=PRODUCTION`
103 # or put that value in .env file
104 # this value is used only when reading files like .toml|yaml|ini|json
105 ENV_FOR_DYNACONF = get(ENV_SWITCHER_FOR_DYNACONF, "DEVELOPMENT")
106 
107 # Default values is taken from DEFAULT pseudo env
108 # this value is used only when reading files like .toml|yaml|ini|json
109 DEFAULT_ENV_FOR_DYNACONF = get("DEFAULT_ENV_FOR_DYNACONF", "DEFAULT")
110 
111 # Global values are taken from DYNACONF env used for exported envvars
112 # Values here overwrites all other envs
113 # This namespace is used for files and also envvars
114 ENVVAR_PREFIX_FOR_DYNACONF = get("ENVVAR_PREFIX_FOR_DYNACONF", "DYNACONF")
115 
116 # The default encoding to open settings files
117 ENCODING_FOR_DYNACONF = get("ENCODING_FOR_DYNACONF", "utf-8")
118 
119 # Merge objects on load
120 MERGE_ENABLED_FOR_DYNACONF = get("MERGE_ENABLED_FOR_DYNACONF", False)
121 
122 # BY default `__` is the separator for nested env vars
123 # export `DYNACONF__DATABASE__server=server.com`
124 # export `DYNACONF__DATABASE__PORT=6666`
125 # Should result in settings.DATABASE == {'server': 'server.com', 'PORT': 6666}
126 # To disable it one can set `NESTED_SEPARATOR_FOR_DYNACONF=false`
127 NESTED_SEPARATOR_FOR_DYNACONF = get("NESTED_SEPARATOR_FOR_DYNACONF", "__")
128 
129 # The env var specifying settings module
130 ENVVAR_FOR_DYNACONF = get("ENVVAR_FOR_DYNACONF", "SETTINGS_FILE_FOR_DYNACONF")
131 
132 # Default values for redis configs
133 default_redis = {
134     "host": get("REDIS_HOST_FOR_DYNACONF", "localhost"),
135     "port": int(get("REDIS_PORT_FOR_DYNACONF", 6379)),
136     "db": int(get("REDIS_DB_FOR_DYNACONF", 0)),
137     "decode_responses": get("REDIS_DECODE_FOR_DYNACONF", True),
138 }
139 REDIS_FOR_DYNACONF = get("REDIS_FOR_DYNACONF", default_redis)
140 REDIS_ENABLED_FOR_DYNACONF = get("REDIS_ENABLED_FOR_DYNACONF", False)
141 
142 # Hashicorp Vault Project
143 vault_scheme = get("VAULT_SCHEME_FOR_DYNACONF", "http")
144 vault_host = get("VAULT_HOST_FOR_DYNACONF", "localhost")
145 vault_port = get("VAULT_PORT_FOR_DYNACONF", "8200")
146 default_vault = {
147     "url": get(
148         "VAULT_URL_FOR_DYNACONF",
149         "{}://{}:{}".format(vault_scheme, vault_host, vault_port),
150     ),
151     "token": get("VAULT_TOKEN_FOR_DYNACONF", None),
152     "cert": get("VAULT_CERT_FOR_DYNACONF", None),
153     "verify": get("VAULT_VERIFY_FOR_DYNACONF", None),
154     "timeout": get("VAULT_TIMEOUT_FOR_DYNACONF", None),
155     "proxies": get("VAULT_PROXIES_FOR_DYNACONF", None),
156     "allow_redirects": get("VAULT_ALLOW_REDIRECTS_FOR_DYNACONF", None),
157 }
158 VAULT_FOR_DYNACONF = get("VAULT_FOR_DYNACONF", default_vault)
159 VAULT_ENABLED_FOR_DYNACONF = get("VAULT_ENABLED_FOR_DYNACONF", False)
160 VAULT_PATH_FOR_DYNACONF = get("VAULT_PATH_FOR_DYNACONF", "dynaconf")
161 VAULT_ROLE_ID_FOR_DYNACONF = get("VAULT_ROLE_ID_FOR_DYNACONF", None)
162 VAULT_SECRET_ID_FOR_DYNACONF = get("VAULT_SECRET_ID_FOR_DYNACONF", None)
163 
164 # Only core loaders defined on this list will be invoked
165 core_loaders = ["YAML", "TOML", "INI", "JSON", "PY"]
166 CORE_LOADERS_FOR_DYNACONF = get("CORE_LOADERS_FOR_DYNACONF", core_loaders)
167 
168 # External Loaders to read vars from different data stores
169 default_loaders = [
170     "dynaconf.loaders.env_loader",
171     # 'dynaconf.loaders.redis_loader'
172     # 'dynaconf.loaders.vault_loader'
173 ]
174 LOADERS_FOR_DYNACONF = get("LOADERS_FOR_DYNACONF", default_loaders)
175 
176 # Errors in loaders should be silenced?
177 SILENT_ERRORS_FOR_DYNACONF = get("SILENT_ERRORS_FOR_DYNACONF", True)
178 
179 # always fresh variables
180 FRESH_VARS_FOR_DYNACONF = get("FRESH_VARS_FOR_DYNACONF", [])
181 
182 # debug
183 DEBUG_LEVEL_FOR_DYNACONF = get("DEBUG_LEVEL_FOR_DYNACONF", "NOTSET")
184 
185 YAML = get("YAML", None)
186 TOML = get("TOML", None)
187 JSON = get("JSON", None)
188 INI = get("INI", None)
189 
190 DOTENV_PATH_FOR_DYNACONF = get("DOTENV_PATH_FOR_DYNACONF", None)
191 DOTENV_VERBOSE_FOR_DYNACONF = get("DOTENV_VERBOSE_FOR_DYNACONF", False)
192 DOTENV_OVERRIDE_FOR_DYNACONF = get("DOTENV_OVERRIDE_FOR_DYNACONF", False)
193 
194 # Currently this is only used by cli. INSTANCE_FOR_DYNACONF specifies python
195 # dotted path to custom LazySettings instance. Last dotted path item should be
196 # instance of LazySettings.
197 INSTANCE_FOR_DYNACONF = get("INSTANCE_FOR_DYNACONF", None)
198 
199 # https://msg.pyyaml.org/load
200 YAML_LOADER_FOR_DYNACONF = get("YAML_LOADER_FOR_DYNACONF", "full_load")
201 
202 # Use commentjson? https://commentjson.readthedocs.io/en/latest/
203 COMMENTJSON_ENABLED_FOR_DYNACONF = get(
204     "COMMENTJSON_ENABLED_FOR_DYNACONF", False
205 )
206 
207 # Extra file, or list of files where to look for secrets
208 # useful for CI environment like jenkins
209 # where you can export this variable pointing to a local
210 # absolute path of the secrets file.
211 SECRETS_FOR_DYNACONF = get("SECRETS_FOR_DYNACONF", None)
212 
213 # To include extra paths based on envvar
214 INCLUDES_FOR_DYNACONF = get("INCLUDES_FOR_DYNACONF", [])
215 
216 # Files to skip if found on search tree
217 SKIP_FILES_FOR_DYNACONF = get("SKIP_FILES_FOR_DYNACONF", [])
218 
219 
220 # Backwards compatibility with renamed variables
221 for old, new in RENAMED_VARS.items():
222     setattr(sys.modules[__name__], old, locals()[new])
223
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/dynaconf/default_settings.py b/dynaconf/default_settings.py
--- a/dynaconf/default_settings.py
+++ b/dynaconf/default_settings.py
@@ -182,11 +182,6 @@
 # debug
 DEBUG_LEVEL_FOR_DYNACONF = get("DEBUG_LEVEL_FOR_DYNACONF", "NOTSET")
 
-YAML = get("YAML", None)
-TOML = get("TOML", None)
-JSON = get("JSON", None)
-INI = get("INI", None)
-
 DOTENV_PATH_FOR_DYNACONF = get("DOTENV_PATH_FOR_DYNACONF", None)
 DOTENV_VERBOSE_FOR_DYNACONF = get("DOTENV_VERBOSE_FOR_DYNACONF", False)
 DOTENV_OVERRIDE_FOR_DYNACONF = get("DOTENV_OVERRIDE_FOR_DYNACONF", False)

{"golden_diff": "diff --git a/dynaconf/default_settings.py b/dynaconf/default_settings.py\n--- a/dynaconf/default_settings.py\n+++ b/dynaconf/default_settings.py\n@@ -182,11 +182,6 @@\n # debug\n DEBUG_LEVEL_FOR_DYNACONF = get(\"DEBUG_LEVEL_FOR_DYNACONF\", \"NOTSET\")\n \n-YAML = get(\"YAML\", None)\n-TOML = get(\"TOML\", None)\n-JSON = get(\"JSON\", None)\n-INI = get(\"INI\", None)\n-\n DOTENV_PATH_FOR_DYNACONF = get(\"DOTENV_PATH_FOR_DYNACONF\", None)\n DOTENV_VERBOSE_FOR_DYNACONF = get(\"DOTENV_VERBOSE_FOR_DYNACONF\", False)\n DOTENV_OVERRIDE_FOR_DYNACONF = get(\"DOTENV_OVERRIDE_FOR_DYNACONF\", False)\n", "issue": "dynaconf.contrib.flask_dynaconf.DynaconfConfig to flask.config.Config\nHello, is there a way to convert a dynaconf.contrib.flask_dynaconf.DynaconfConfig object into a flask.config.Config one?\r\nOtherwise, is there a way to convert dynaconf.contrib.flask_dynaconf.DynaconfConfig into a dict?\r\n\r\nI have been struggling trying to pass a dynaconf.contrib.flask_dynaconf.DynaconfConfig to a Flask Cache constructor as a config. With flask.config.Config it works but with the dynaconf class it doesn't :-/.\r\n \r\ncache = Cache().init_app(app, app.config)\r\n\n", "before_files": [{"content": "import importlib\nimport os\nimport sys\nimport warnings\n\nfrom dynaconf.utils import raw_logger\nfrom dynaconf.utils import RENAMED_VARS\nfrom dynaconf.utils import warn_deprecations\nfrom dynaconf.utils.files import find_file\nfrom dynaconf.utils.parse_conf import parse_conf_data\n\ntry:\n    from dotenv import load_dotenv\nexcept ImportError:  # pragma: no cover\n    load_dotenv = lambda *args, **kwargs: None  # noqa\n\n\ndef try_renamed(key, value, older_key, current_key):\n    if value is None:\n        if key == current_key:\n            if older_key in os.environ:\n                warnings.warn(\n                    \"{0} is deprecated please use {1}\".format(\n                        older_key, current_key\n                    ),\n                    DeprecationWarning,\n                )\n                value = os.environ[older_key]\n    return value\n\n\ndef get(key, default=None):\n    value = os.environ.get(key.upper())\n\n    # compatibility with renamed variables\n    for old, new in RENAMED_VARS.items():\n        value = try_renamed(key, value, old, new)\n\n    return (\n        parse_conf_data(value, tomlfy=True) if value is not None else default\n    )\n\n\ndef start_dotenv(obj=None, root_path=None):\n    # load_from_dotenv_if_installed\n    obj = obj or {}\n    _find_file = getattr(obj, \"find_file\", find_file)\n    root_path = (\n        root_path\n        or getattr(obj, \"_root_path\", None)\n        or get(\"ROOT_PATH_FOR_DYNACONF\")\n    )\n    raw_logger().debug(\n        \"Starting Dynaconf Dotenv %s\",\n        \"for {0}\".format(root_path) if root_path else \"Base\",\n    )\n\n    dotenv_path = (\n        obj.get(\"DOTENV_PATH_FOR_DYNACONF\")\n        or get(\"DOTENV_PATH_FOR_DYNACONF\")\n        or _find_file(\".env\", project_root=root_path)\n    )\n\n    load_dotenv(\n        dotenv_path,\n        verbose=obj.get(\"DOTENV_VERBOSE_FOR_DYNACONF\", False),\n        override=obj.get(\"DOTENV_OVERRIDE_FOR_DYNACONF\", False),\n    )\n\n    warn_deprecations(os.environ)\n\n\ndef reload(*args, **kwargs):\n    start_dotenv(*args, **kwargs)\n    importlib.reload(sys.modules[__name__])\n\n\n# default proj root\n# pragma: no cover\nROOT_PATH_FOR_DYNACONF = get(\"ROOT_PATH_FOR_DYNACONF\", None)\n\n# Default settings file\ndefault_paths = (\n    \"settings.py,.secrets.py,\"\n    \"settings.toml,settings.tml,.secrets.toml,.secrets.tml,\"\n    \"settings.yaml,settings.yml,.secrets.yaml,.secrets.yml,\"\n    \"settings.ini,settings.conf,settings.properties,\"\n    \".secrets.ini,.secrets.conf,.secrets.properties,\"\n    \"settings.json,.secrets.json\"\n)\nSETTINGS_FILE_FOR_DYNACONF = get(\"SETTINGS_FILE_FOR_DYNACONF\", default_paths)\n\n# # ENV SETTINGS\n# # In dynaconf 1.0.0 `NAMESPACE` got renamed to `ENV`\n\n# The environment variable to switch current env\nENV_SWITCHER_FOR_DYNACONF = get(\n    \"ENV_SWITCHER_FOR_DYNACONF\", \"ENV_FOR_DYNACONF\"\n)\n\n# The current env by default is DEVELOPMENT\n# to switch is needed to `export ENV_FOR_DYNACONF=PRODUCTION`\n# or put that value in .env file\n# this value is used only when reading files like .toml|yaml|ini|json\nENV_FOR_DYNACONF = get(ENV_SWITCHER_FOR_DYNACONF, \"DEVELOPMENT\")\n\n# Default values is taken from DEFAULT pseudo env\n# this value is used only when reading files like .toml|yaml|ini|json\nDEFAULT_ENV_FOR_DYNACONF = get(\"DEFAULT_ENV_FOR_DYNACONF\", \"DEFAULT\")\n\n# Global values are taken from DYNACONF env used for exported envvars\n# Values here overwrites all other envs\n# This namespace is used for files and also envvars\nENVVAR_PREFIX_FOR_DYNACONF = get(\"ENVVAR_PREFIX_FOR_DYNACONF\", \"DYNACONF\")\n\n# The default encoding to open settings files\nENCODING_FOR_DYNACONF = get(\"ENCODING_FOR_DYNACONF\", \"utf-8\")\n\n# Merge objects on load\nMERGE_ENABLED_FOR_DYNACONF = get(\"MERGE_ENABLED_FOR_DYNACONF\", False)\n\n# BY default `__` is the separator for nested env vars\n# export `DYNACONF__DATABASE__server=server.com`\n# export `DYNACONF__DATABASE__PORT=6666`\n# Should result in settings.DATABASE == {'server': 'server.com', 'PORT': 6666}\n# To disable it one can set `NESTED_SEPARATOR_FOR_DYNACONF=false`\nNESTED_SEPARATOR_FOR_DYNACONF = get(\"NESTED_SEPARATOR_FOR_DYNACONF\", \"__\")\n\n# The env var specifying settings module\nENVVAR_FOR_DYNACONF = get(\"ENVVAR_FOR_DYNACONF\", \"SETTINGS_FILE_FOR_DYNACONF\")\n\n# Default values for redis configs\ndefault_redis = {\n    \"host\": get(\"REDIS_HOST_FOR_DYNACONF\", \"localhost\"),\n    \"port\": int(get(\"REDIS_PORT_FOR_DYNACONF\", 6379)),\n    \"db\": int(get(\"REDIS_DB_FOR_DYNACONF\", 0)),\n    \"decode_responses\": get(\"REDIS_DECODE_FOR_DYNACONF\", True),\n}\nREDIS_FOR_DYNACONF = get(\"REDIS_FOR_DYNACONF\", default_redis)\nREDIS_ENABLED_FOR_DYNACONF = get(\"REDIS_ENABLED_FOR_DYNACONF\", False)\n\n# Hashicorp Vault Project\nvault_scheme = get(\"VAULT_SCHEME_FOR_DYNACONF\", \"http\")\nvault_host = get(\"VAULT_HOST_FOR_DYNACONF\", \"localhost\")\nvault_port = get(\"VAULT_PORT_FOR_DYNACONF\", \"8200\")\ndefault_vault = {\n    \"url\": get(\n        \"VAULT_URL_FOR_DYNACONF\",\n        \"{}://{}:{}\".format(vault_scheme, vault_host, vault_port),\n    ),\n    \"token\": get(\"VAULT_TOKEN_FOR_DYNACONF\", None),\n    \"cert\": get(\"VAULT_CERT_FOR_DYNACONF\", None),\n    \"verify\": get(\"VAULT_VERIFY_FOR_DYNACONF\", None),\n    \"timeout\": get(\"VAULT_TIMEOUT_FOR_DYNACONF\", None),\n    \"proxies\": get(\"VAULT_PROXIES_FOR_DYNACONF\", None),\n    \"allow_redirects\": get(\"VAULT_ALLOW_REDIRECTS_FOR_DYNACONF\", None),\n}\nVAULT_FOR_DYNACONF = get(\"VAULT_FOR_DYNACONF\", default_vault)\nVAULT_ENABLED_FOR_DYNACONF = get(\"VAULT_ENABLED_FOR_DYNACONF\", False)\nVAULT_PATH_FOR_DYNACONF = get(\"VAULT_PATH_FOR_DYNACONF\", \"dynaconf\")\nVAULT_ROLE_ID_FOR_DYNACONF = get(\"VAULT_ROLE_ID_FOR_DYNACONF\", None)\nVAULT_SECRET_ID_FOR_DYNACONF = get(\"VAULT_SECRET_ID_FOR_DYNACONF\", None)\n\n# Only core loaders defined on this list will be invoked\ncore_loaders = [\"YAML\", \"TOML\", \"INI\", \"JSON\", \"PY\"]\nCORE_LOADERS_FOR_DYNACONF = get(\"CORE_LOADERS_FOR_DYNACONF\", core_loaders)\n\n# External Loaders to read vars from different data stores\ndefault_loaders = [\n    \"dynaconf.loaders.env_loader\",\n    # 'dynaconf.loaders.redis_loader'\n    # 'dynaconf.loaders.vault_loader'\n]\nLOADERS_FOR_DYNACONF = get(\"LOADERS_FOR_DYNACONF\", default_loaders)\n\n# Errors in loaders should be silenced?\nSILENT_ERRORS_FOR_DYNACONF = get(\"SILENT_ERRORS_FOR_DYNACONF\", True)\n\n# always fresh variables\nFRESH_VARS_FOR_DYNACONF = get(\"FRESH_VARS_FOR_DYNACONF\", [])\n\n# debug\nDEBUG_LEVEL_FOR_DYNACONF = get(\"DEBUG_LEVEL_FOR_DYNACONF\", \"NOTSET\")\n\nYAML = get(\"YAML\", None)\nTOML = get(\"TOML\", None)\nJSON = get(\"JSON\", None)\nINI = get(\"INI\", None)\n\nDOTENV_PATH_FOR_DYNACONF = get(\"DOTENV_PATH_FOR_DYNACONF\", None)\nDOTENV_VERBOSE_FOR_DYNACONF = get(\"DOTENV_VERBOSE_FOR_DYNACONF\", False)\nDOTENV_OVERRIDE_FOR_DYNACONF = get(\"DOTENV_OVERRIDE_FOR_DYNACONF\", False)\n\n# Currently this is only used by cli. INSTANCE_FOR_DYNACONF specifies python\n# dotted path to custom LazySettings instance. Last dotted path item should be\n# instance of LazySettings.\nINSTANCE_FOR_DYNACONF = get(\"INSTANCE_FOR_DYNACONF\", None)\n\n# https://msg.pyyaml.org/load\nYAML_LOADER_FOR_DYNACONF = get(\"YAML_LOADER_FOR_DYNACONF\", \"full_load\")\n\n# Use commentjson? https://commentjson.readthedocs.io/en/latest/\nCOMMENTJSON_ENABLED_FOR_DYNACONF = get(\n    \"COMMENTJSON_ENABLED_FOR_DYNACONF\", False\n)\n\n# Extra file, or list of files where to look for secrets\n# useful for CI environment like jenkins\n# where you can export this variable pointing to a local\n# absolute path of the secrets file.\nSECRETS_FOR_DYNACONF = get(\"SECRETS_FOR_DYNACONF\", None)\n\n# To include extra paths based on envvar\nINCLUDES_FOR_DYNACONF = get(\"INCLUDES_FOR_DYNACONF\", [])\n\n# Files to skip if found on search tree\nSKIP_FILES_FOR_DYNACONF = get(\"SKIP_FILES_FOR_DYNACONF\", [])\n\n\n# Backwards compatibility with renamed variables\nfor old, new in RENAMED_VARS.items():\n    setattr(sys.modules[__name__], old, locals()[new])\n", "path": "dynaconf/default_settings.py"}], "after_files": [{"content": "import importlib\nimport os\nimport sys\nimport warnings\n\nfrom dynaconf.utils import raw_logger\nfrom dynaconf.utils import RENAMED_VARS\nfrom dynaconf.utils import warn_deprecations\nfrom dynaconf.utils.files import find_file\nfrom dynaconf.utils.parse_conf import parse_conf_data\n\ntry:\n    from dotenv import load_dotenv\nexcept ImportError:  # pragma: no cover\n    load_dotenv = lambda *args, **kwargs: None  # noqa\n\n\ndef try_renamed(key, value, older_key, current_key):\n    if value is None:\n        if key == current_key:\n            if older_key in os.environ:\n                warnings.warn(\n                    \"{0} is deprecated please use {1}\".format(\n                        older_key, current_key\n                    ),\n                    DeprecationWarning,\n                )\n                value = os.environ[older_key]\n    return value\n\n\ndef get(key, default=None):\n    value = os.environ.get(key.upper())\n\n    # compatibility with renamed variables\n    for old, new in RENAMED_VARS.items():\n        value = try_renamed(key, value, old, new)\n\n    return (\n        parse_conf_data(value, tomlfy=True) if value is not None else default\n    )\n\n\ndef start_dotenv(obj=None, root_path=None):\n    # load_from_dotenv_if_installed\n    obj = obj or {}\n    _find_file = getattr(obj, \"find_file\", find_file)\n    root_path = (\n        root_path\n        or getattr(obj, \"_root_path\", None)\n        or get(\"ROOT_PATH_FOR_DYNACONF\")\n    )\n    raw_logger().debug(\n        \"Starting Dynaconf Dotenv %s\",\n        \"for {0}\".format(root_path) if root_path else \"Base\",\n    )\n\n    dotenv_path = (\n        obj.get(\"DOTENV_PATH_FOR_DYNACONF\")\n        or get(\"DOTENV_PATH_FOR_DYNACONF\")\n        or _find_file(\".env\", project_root=root_path)\n    )\n\n    load_dotenv(\n        dotenv_path,\n        verbose=obj.get(\"DOTENV_VERBOSE_FOR_DYNACONF\", False),\n        override=obj.get(\"DOTENV_OVERRIDE_FOR_DYNACONF\", False),\n    )\n\n    warn_deprecations(os.environ)\n\n\ndef reload(*args, **kwargs):\n    start_dotenv(*args, **kwargs)\n    importlib.reload(sys.modules[__name__])\n\n\n# default proj root\n# pragma: no cover\nROOT_PATH_FOR_DYNACONF = get(\"ROOT_PATH_FOR_DYNACONF\", None)\n\n# Default settings file\ndefault_paths = (\n    \"settings.py,.secrets.py,\"\n    \"settings.toml,settings.tml,.secrets.toml,.secrets.tml,\"\n    \"settings.yaml,settings.yml,.secrets.yaml,.secrets.yml,\"\n    \"settings.ini,settings.conf,settings.properties,\"\n    \".secrets.ini,.secrets.conf,.secrets.properties,\"\n    \"settings.json,.secrets.json\"\n)\nSETTINGS_FILE_FOR_DYNACONF = get(\"SETTINGS_FILE_FOR_DYNACONF\", default_paths)\n\n# # ENV SETTINGS\n# # In dynaconf 1.0.0 `NAMESPACE` got renamed to `ENV`\n\n# The environment variable to switch current env\nENV_SWITCHER_FOR_DYNACONF = get(\n    \"ENV_SWITCHER_FOR_DYNACONF\", \"ENV_FOR_DYNACONF\"\n)\n\n# The current env by default is DEVELOPMENT\n# to switch is needed to `export ENV_FOR_DYNACONF=PRODUCTION`\n# or put that value in .env file\n# this value is used only when reading files like .toml|yaml|ini|json\nENV_FOR_DYNACONF = get(ENV_SWITCHER_FOR_DYNACONF, \"DEVELOPMENT\")\n\n# Default values is taken from DEFAULT pseudo env\n# this value is used only when reading files like .toml|yaml|ini|json\nDEFAULT_ENV_FOR_DYNACONF = get(\"DEFAULT_ENV_FOR_DYNACONF\", \"DEFAULT\")\n\n# Global values are taken from DYNACONF env used for exported envvars\n# Values here overwrites all other envs\n# This namespace is used for files and also envvars\nENVVAR_PREFIX_FOR_DYNACONF = get(\"ENVVAR_PREFIX_FOR_DYNACONF\", \"DYNACONF\")\n\n# The default encoding to open settings files\nENCODING_FOR_DYNACONF = get(\"ENCODING_FOR_DYNACONF\", \"utf-8\")\n\n# Merge objects on load\nMERGE_ENABLED_FOR_DYNACONF = get(\"MERGE_ENABLED_FOR_DYNACONF\", False)\n\n# BY default `__` is the separator for nested env vars\n# export `DYNACONF__DATABASE__server=server.com`\n# export `DYNACONF__DATABASE__PORT=6666`\n# Should result in settings.DATABASE == {'server': 'server.com', 'PORT': 6666}\n# To disable it one can set `NESTED_SEPARATOR_FOR_DYNACONF=false`\nNESTED_SEPARATOR_FOR_DYNACONF = get(\"NESTED_SEPARATOR_FOR_DYNACONF\", \"__\")\n\n# The env var specifying settings module\nENVVAR_FOR_DYNACONF = get(\"ENVVAR_FOR_DYNACONF\", \"SETTINGS_FILE_FOR_DYNACONF\")\n\n# Default values for redis configs\ndefault_redis = {\n    \"host\": get(\"REDIS_HOST_FOR_DYNACONF\", \"localhost\"),\n    \"port\": int(get(\"REDIS_PORT_FOR_DYNACONF\", 6379)),\n    \"db\": int(get(\"REDIS_DB_FOR_DYNACONF\", 0)),\n    \"decode_responses\": get(\"REDIS_DECODE_FOR_DYNACONF\", True),\n}\nREDIS_FOR_DYNACONF = get(\"REDIS_FOR_DYNACONF\", default_redis)\nREDIS_ENABLED_FOR_DYNACONF = get(\"REDIS_ENABLED_FOR_DYNACONF\", False)\n\n# Hashicorp Vault Project\nvault_scheme = get(\"VAULT_SCHEME_FOR_DYNACONF\", \"http\")\nvault_host = get(\"VAULT_HOST_FOR_DYNACONF\", \"localhost\")\nvault_port = get(\"VAULT_PORT_FOR_DYNACONF\", \"8200\")\ndefault_vault = {\n    \"url\": get(\n        \"VAULT_URL_FOR_DYNACONF\",\n        \"{}://{}:{}\".format(vault_scheme, vault_host, vault_port),\n    ),\n    \"token\": get(\"VAULT_TOKEN_FOR_DYNACONF\", None),\n    \"cert\": get(\"VAULT_CERT_FOR_DYNACONF\", None),\n    \"verify\": get(\"VAULT_VERIFY_FOR_DYNACONF\", None),\n    \"timeout\": get(\"VAULT_TIMEOUT_FOR_DYNACONF\", None),\n    \"proxies\": get(\"VAULT_PROXIES_FOR_DYNACONF\", None),\n    \"allow_redirects\": get(\"VAULT_ALLOW_REDIRECTS_FOR_DYNACONF\", None),\n}\nVAULT_FOR_DYNACONF = get(\"VAULT_FOR_DYNACONF\", default_vault)\nVAULT_ENABLED_FOR_DYNACONF = get(\"VAULT_ENABLED_FOR_DYNACONF\", False)\nVAULT_PATH_FOR_DYNACONF = get(\"VAULT_PATH_FOR_DYNACONF\", \"dynaconf\")\nVAULT_ROLE_ID_FOR_DYNACONF = get(\"VAULT_ROLE_ID_FOR_DYNACONF\", None)\nVAULT_SECRET_ID_FOR_DYNACONF = get(\"VAULT_SECRET_ID_FOR_DYNACONF\", None)\n\n# Only core loaders defined on this list will be invoked\ncore_loaders = [\"YAML\", \"TOML\", \"INI\", \"JSON\", \"PY\"]\nCORE_LOADERS_FOR_DYNACONF = get(\"CORE_LOADERS_FOR_DYNACONF\", core_loaders)\n\n# External Loaders to read vars from different data stores\ndefault_loaders = [\n    \"dynaconf.loaders.env_loader\",\n    # 'dynaconf.loaders.redis_loader'\n    # 'dynaconf.loaders.vault_loader'\n]\nLOADERS_FOR_DYNACONF = get(\"LOADERS_FOR_DYNACONF\", default_loaders)\n\n# Errors in loaders should be silenced?\nSILENT_ERRORS_FOR_DYNACONF = get(\"SILENT_ERRORS_FOR_DYNACONF\", True)\n\n# always fresh variables\nFRESH_VARS_FOR_DYNACONF = get(\"FRESH_VARS_FOR_DYNACONF\", [])\n\n# debug\nDEBUG_LEVEL_FOR_DYNACONF = get(\"DEBUG_LEVEL_FOR_DYNACONF\", \"NOTSET\")\n\nDOTENV_PATH_FOR_DYNACONF = get(\"DOTENV_PATH_FOR_DYNACONF\", None)\nDOTENV_VERBOSE_FOR_DYNACONF = get(\"DOTENV_VERBOSE_FOR_DYNACONF\", False)\nDOTENV_OVERRIDE_FOR_DYNACONF = get(\"DOTENV_OVERRIDE_FOR_DYNACONF\", False)\n\n# Currently this is only used by cli. INSTANCE_FOR_DYNACONF specifies python\n# dotted path to custom LazySettings instance. Last dotted path item should be\n# instance of LazySettings.\nINSTANCE_FOR_DYNACONF = get(\"INSTANCE_FOR_DYNACONF\", None)\n\n# https://msg.pyyaml.org/load\nYAML_LOADER_FOR_DYNACONF = get(\"YAML_LOADER_FOR_DYNACONF\", \"full_load\")\n\n# Use commentjson? https://commentjson.readthedocs.io/en/latest/\nCOMMENTJSON_ENABLED_FOR_DYNACONF = get(\n    \"COMMENTJSON_ENABLED_FOR_DYNACONF\", False\n)\n\n# Extra file, or list of files where to look for secrets\n# useful for CI environment like jenkins\n# where you can export this variable pointing to a local\n# absolute path of the secrets file.\nSECRETS_FOR_DYNACONF = get(\"SECRETS_FOR_DYNACONF\", None)\n\n# To include extra paths based on envvar\nINCLUDES_FOR_DYNACONF = get(\"INCLUDES_FOR_DYNACONF\", [])\n\n# Files to skip if found on search tree\nSKIP_FILES_FOR_DYNACONF = get(\"SKIP_FILES_FOR_DYNACONF\", [])\n\n\n# Backwards compatibility with renamed variables\nfor old, new in RENAMED_VARS.items():\n    setattr(sys.modules[__name__], old, locals()[new])\n", "path": "dynaconf/default_settings.py"}]}