MrA7A commited on
Commit
a7f1293
·
verified ·
1 Parent(s): 568cc59

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -26,6 +26,13 @@ app = FastAPI()
26
  # --- Configuration ---
27
  MODELS_DIR = "/home/kabo/Desktop/p/models/"
28
 
 
 
 
 
 
 
 
29
  # Initialize Firebase
30
  # استخدام متغيرات البيئة لاعتمادات Firebase:
31
  firebase_creds_path = os.getenv("FIREBASE_CREDS_PATH", "cred.json")
@@ -39,12 +46,7 @@ if not firebase_admin._apps:
39
  logger.error(f"Failed to initialize Firebase: {e}. Ensure FIREBASE_CREDS_PATH is set correctly and the file exists.")
40
  db = None # Set db to None if initialization fails
41
 
42
- # --- Logging Setup ---
43
- logging.basicConfig(
44
- level=logging.INFO,
45
- format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
46
- )
47
- logger = logging.getLogger(__name__)
48
 
49
  # --- API Key Authentication ---
50
  API_KEY_NAME = "X-API-KEY"
 
26
  # --- Configuration ---
27
  MODELS_DIR = "/home/kabo/Desktop/p/models/"
28
 
29
+ # --- Logging Setup ---
30
+ logging.basicConfig(
31
+ level=logging.INFO,
32
+ format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
33
+ )
34
+ logger = logging.getLogger(__name__)
35
+
36
  # Initialize Firebase
37
  # استخدام متغيرات البيئة لاعتمادات Firebase:
38
  firebase_creds_path = os.getenv("FIREBASE_CREDS_PATH", "cred.json")
 
46
  logger.error(f"Failed to initialize Firebase: {e}. Ensure FIREBASE_CREDS_PATH is set correctly and the file exists.")
47
  db = None # Set db to None if initialization fails
48
 
49
+
 
 
 
 
 
50
 
51
  # --- API Key Authentication ---
52
  API_KEY_NAME = "X-API-KEY"