AIdeaText commited on
Commit
783d70f
verified
1 Parent(s): 22d5794

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -0
app.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+ import logging
4
+ from modules.auth.auth import create_auth_interface
5
+ from modules.database.database_init import initialize_database_connections
6
+
7
+ # Configuraci贸n b谩sica
8
+ logging.basicConfig(level=logging.INFO)
9
+ logger = logging.getLogger(__name__)
10
+
11
+ # Verificar variables de entorno
12
+ COSMOS_ENDPOINT = os.getenv("COSMOS_ENDPOINT")
13
+ COSMOS_KEY = os.getenv("COSMOS_KEY")
14
+ if not COSMOS_ENDPOINT or not COSMOS_KEY:
15
+ raise ValueError("Faltan variables de entorno: COSMOS_ENDPOINT y COSMOS_KEY.")
16
+
17
+ # Inicializar la conexi贸n a la base de datos
18
+ if not initialize_database_connections():
19
+ raise ValueError("No se pudo inicializar la conexi贸n a la base de datos.")
20
+
21
+ # Crear la interfaz de login
22
+ app = create_auth_interface()
23
+
24
+ # Lanzar la aplicaci贸n
25
+ if __name__ == "__main__":
26
+ app.launch(server_name="0.0.0.0", server_port=7860, auth=None)