Update config.py
Browse files
config.py
CHANGED
|
@@ -8,17 +8,22 @@ from functools import lru_cache
|
|
| 8 |
|
| 9 |
# Determine .env path - check both current dir and parent dir
|
| 10 |
def find_env_file():
|
| 11 |
-
"""Find .env file in
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
# Check backend directory
|
| 15 |
-
if os.path.exists(os.path.join(
|
| 16 |
-
return os.path.join(
|
| 17 |
-
|
| 18 |
-
# Check
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
return os.path.join(parent_dir, ".env")
|
| 22 |
|
| 23 |
return ".env"
|
| 24 |
|
|
|
|
| 8 |
|
| 9 |
# Determine .env path - check both current dir and parent dir
|
| 10 |
def find_env_file():
|
| 11 |
+
"""Find .env file in app, backend, or project root directory"""
|
| 12 |
+
app_dir = os.path.dirname(os.path.abspath(__file__))
|
| 13 |
+
backend_dir = os.path.dirname(app_dir)
|
| 14 |
+
project_root_dir = os.path.dirname(backend_dir)
|
| 15 |
+
|
| 16 |
+
# Check app directory (this folder)
|
| 17 |
+
if os.path.exists(os.path.join(app_dir, ".env")):
|
| 18 |
+
return os.path.join(app_dir, ".env")
|
| 19 |
+
|
| 20 |
# Check backend directory
|
| 21 |
+
if os.path.exists(os.path.join(backend_dir, ".env")):
|
| 22 |
+
return os.path.join(backend_dir, ".env")
|
| 23 |
+
|
| 24 |
+
# Check project root directory
|
| 25 |
+
if os.path.exists(os.path.join(project_root_dir, ".env")):
|
| 26 |
+
return os.path.join(project_root_dir, ".env")
|
|
|
|
| 27 |
|
| 28 |
return ".env"
|
| 29 |
|