File size: 2,787 Bytes
e09caf0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3d22685
479593e
e09caf0
3d22685
 
 
 
 
 
e09caf0
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
""" #######################################################################################

# RECURSO ACAD脡MICO CREADO POR LA PROFESORA M脫NICA TAHAN CON EL USO DE GOOGLE ANTIGRAVITY #

# ACADEMY RESOURCE CREATED BY PROFESSOR M脫NICA TAHAN WITH THE USE OF GOOGLE ANTIGRAVITY   #

# Este programa web desarrollado con Flask permite registrar, modificar, eliminar y       #

# consultar personas   #

# This script is a web application that allows you to register, modify, delete and        #

# consult people                                                                          #

# Product Owner: Prof. M贸nica Tahan                                                       #

# Autor: M贸nica Tahan y Google Antigravity AI                                             #

# Author: M贸nica Tahan and Google Antigravity AI                                          #

# Versi贸n: 1.0                                                                            #

# Version: 1.0                                                                            #

# Fecha: 28/02/2026                                                                       # 

# Date: 02/28/2026                                                                        #

# Licencia: GNU/GPL                                                                       #

# License: GNU/GPL                                                                        #

###########################################################################################

"""

from flask import Flask # Importamos la clase principal
from controllers.persona import persona_bp # Importamos el controlador Persona
from controllers.auth import auth_bp # Importamos el controlador Auth
import os

app = Flask(__name__)

# CONFIGURACION DE SESIONES Y SEGURIDAD
# Para producci贸n en Hugging Face (que usa iframes), necesitamos que las cookies sean estables y compatibles.
app.secret_key = "unexpo-computacion1-seccion37-clave-segura"

# Configuraciones para que la sesi贸n funcione dentro del iframe de Hugging Face
app.config.update(
    SESSION_COOKIE_SAMESITE='None',
    SESSION_COOKIE_SECURE=True
)

# Registramos los controladores (Blueprints)
# 'url_prefix' nos permite separar rutas l贸gicas f谩cilmente.
# 'auth' tendr谩 rutas como '/auth/login', '/auth/logout'
app.register_blueprint(auth_bp, url_prefix='/auth')
# 'persona' ser谩 la ra铆z '/'
app.register_blueprint(persona_bp, url_prefix='/')

# INICIO DE LA APLICACION
if __name__ == '__main__':
    # Obtenemos el puerto de las variables de entorno para Hugging Face (default 7860)
    port = int(os.environ.get("PORT", 7860))
    # Escuchamos en 0.0.0.0 para que el contenedor sea accesible
    app.run(host='0.0.0.0', port=port, debug=False)