4343argon2 = Argon2 (app )
4444ph = PasswordHasher ()
4545
46+ print ("configuracion inicial completada ..." )
4647
4748# --- CONFIGURACIÓN DE CARPETAS ---
4849UPLOAD_FOLDER = './cuarentena'
4950os .makedirs (UPLOAD_FOLDER , exist_ok = True )
5051app .config ['UPLOAD_FOLDER' ] = UPLOAD_FOLDER
5152
53+ print ("verificacion de archivos demo ..." )
5254
5355# --- USUARIOS BASE ---
5456users = {
6668 }
6769}
6870
69-
71+ print ("usuarios base generados..." )
72+ '''
7073# --- DEMO USERS DESDE ENV ---
7174try:
7275 demo_users_env = os.getenv("DEMO_USERS", "[]")
7982except Exception as e:
8083 print(f"[WARN] No se pudieron cargar demo_users: {e}")
8184
82-
85+ print("usuarios demo creados ....")
86+ '''
8387# --- LOGIN MANAGER ---
8488login_manager = LoginManager (app )
8589login_manager .login_view = 'login'
@@ -95,7 +99,7 @@ def load_user(user_id):
9599 return Usuario (user_id , users [user_id ]['role' ])
96100 return None
97101
98-
102+ print ( "login initializied... Starting app...." )
99103# --- RUTAS ---
100104@app .route ('/' )
101105def home ():
@@ -120,7 +124,7 @@ def login():
120124 return render_template ("login.html" , error = "Credenciales inválidas." )
121125 return render_template ("login.html" )
122126
123- @app .route ('/logout' )
127+ @app .route ('/logout' , methods = [ 'GET' , 'POST' ] )
124128@login_required
125129def logout ():
126130 logout_user ()
@@ -217,7 +221,7 @@ def handle_message(data):
217221
218222# --- INICIO ---
219223if __name__ == '__main__' :
220- port = int (os .environ .get ("PORT" , 10000 ))
224+ port = int (os .environ .get ("PORT" , 8080 ))
221225 socketio .run (app , host = '0.0.0.0' , port = port ) # 👉 Para gunicorn/render
222-
226+ print ( f"app running at host : 0.0.0.0 and port { port } " )
223227application = app
0 commit comments