Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,17 +4,21 @@ from pydantic import BaseModel
|
|
| 4 |
import os
|
| 5 |
import importlib
|
| 6 |
|
| 7 |
-
|
| 8 |
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# ---------- FastAPI app ----------
|
| 20 |
app = FastAPI(title="Stock / Index Backend")
|
|
|
|
| 4 |
import os
|
| 5 |
import importlib
|
| 6 |
|
| 7 |
+
|
| 8 |
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 9 |
|
| 10 |
+
# Optional: define explicit import order if needed
|
| 11 |
+
module_order = ["common", "stock", "indices_html", "index_live_html",
|
| 12 |
+
"preopen_html", "eq_html", "bhavcopy_html",
|
| 13 |
+
"nsepython", "yahooinfo", "build_nse_fno"]
|
| 14 |
+
|
| 15 |
+
for module_name in module_order:
|
| 16 |
+
try:
|
| 17 |
+
globals()[module_name] = importlib.import_module(module_name)
|
| 18 |
+
print(f"Imported module: {module_name}")
|
| 19 |
+
except Exception as e:
|
| 20 |
+
print(f"Failed to import {module_name}: {e}")
|
| 21 |
+
|
| 22 |
|
| 23 |
# ---------- FastAPI app ----------
|
| 24 |
app = FastAPI(title="Stock / Index Backend")
|