26 lines
669 B
Python
26 lines
669 B
Python
import os
|
|
|
|
from dynaconf import Dynaconf
|
|
|
|
|
|
def get_dynaconf_related_config_files():
|
|
config_folder_path = 'localdata'
|
|
config_file_paths = []
|
|
|
|
for filename in os.listdir(config_folder_path):
|
|
if filename.endswith('.yml') or filename.endswith(".yaml"):
|
|
file_path = os.path.join(config_folder_path, filename)
|
|
config_file_paths.append(file_path)
|
|
|
|
return config_file_paths
|
|
|
|
|
|
# --- DynaConf ---------------------------------------------------------------------------------------------------------
|
|
|
|
envvar = Dynaconf(
|
|
envvar_prefix="DAYTRADE",
|
|
environments=True,
|
|
settings_files=get_dynaconf_related_config_files(),
|
|
)
|
|
|