userIdc2024 commited on
Commit
3d81e4d
·
verified ·
1 Parent(s): b0ee0be

Update core/settings.py

Browse files
Files changed (1) hide show
  1. core/settings.py +6 -4
core/settings.py CHANGED
@@ -9,10 +9,12 @@ from pydantic_settings import BaseSettings
9
 
10
 
11
  def load_env_config():
12
- if GlobalConfig().APP_ENV != "dev":
13
- return dotenv_values()
14
- else:
15
- return dict(os.environ)
 
 
16
 
17
 
18
  def get_config() -> Dict[str, Any]:
 
9
 
10
 
11
  def load_env_config():
12
+ # Try to load from .env file first, then fall back to environment variables
13
+ env_file_config = dotenv_values()
14
+ env_vars = dict(os.environ)
15
+
16
+ # Merge .env file values with environment variables (env vars take precedence)
17
+ return {**env_file_config, **env_vars}
18
 
19
 
20
  def get_config() -> Dict[str, Any]: