Update app.py
Browse files
app.py
CHANGED
@@ -1,19 +1,28 @@
|
|
1 |
import os
|
2 |
import sys
|
3 |
|
4 |
-
# Add the
|
5 |
-
|
|
|
|
|
6 |
|
7 |
-
|
8 |
-
|
9 |
|
10 |
-
|
|
|
|
|
11 |
|
12 |
-
# Import modules
|
13 |
-
|
14 |
-
from routes.
|
15 |
-
from routes.
|
16 |
-
from
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
# Initialize necessary files
|
19 |
initialize_files()
|
|
|
1 |
import os
|
2 |
import sys
|
3 |
|
4 |
+
# Add the current working directory explicitly to the Python path
|
5 |
+
current_dir = os.path.dirname(os.path.abspath(__file__))
|
6 |
+
if current_dir not in sys.path:
|
7 |
+
sys.path.insert(0, current_dir)
|
8 |
|
9 |
+
# Debugging: Print the module search path
|
10 |
+
print("DEBUG: sys.path =", sys.path)
|
11 |
|
12 |
+
# Debugging: Verify the existence of key directories and files
|
13 |
+
print("DEBUG: Does 'routes' directory exist? ", os.path.exists(os.path.join(current_dir, "routes")))
|
14 |
+
print("DEBUG: Does 'auth.py' exist in 'routes'? ", os.path.exists(os.path.join(current_dir, "routes", "auth.py")))
|
15 |
|
16 |
+
# Import modules
|
17 |
+
try:
|
18 |
+
from routes.auth import login, sign_up
|
19 |
+
from routes.menu import load_menu
|
20 |
+
from routes.orders import add_to_order, view_order, place_order
|
21 |
+
from utils.file_initializer import initialize_files
|
22 |
+
except ModuleNotFoundError as e:
|
23 |
+
print(f"ERROR: {e}")
|
24 |
+
print("DEBUG: ModuleNotFoundError occurred. Check the paths and file structure.")
|
25 |
+
sys.exit(1)
|
26 |
|
27 |
# Initialize necessary files
|
28 |
initialize_files()
|