ViannyCruz commited on
Commit
f0cfd96
·
verified ·
1 Parent(s): 376dc84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -30,6 +30,13 @@ app = Flask(__name__, static_folder='web', static_url_path='')
30
  app.secret_key = os.environ.get("SECRET_KEY", "medical-app-secret-2024-change-in-prod")
31
  app.permanent_session_lifetime = timedelta(hours=8)
32
 
 
 
 
 
 
 
 
33
  db = DatabaseManager()
34
  model = None
35
  CLASS_NAMES = ['Diabetic Retinopathy', 'No Diabetic Retinopathy']
@@ -691,4 +698,4 @@ if __name__ == '__main__':
691
  print("Cargando modelo de TensorFlow...")
692
  load_model()
693
  port = int(os.environ.get('PORT', 7860))
694
- app.run(host='0.0.0.0', port=port, debug=False)
 
30
  app.secret_key = os.environ.get("SECRET_KEY", "medical-app-secret-2024-change-in-prod")
31
  app.permanent_session_lifetime = timedelta(hours=8)
32
 
33
+ # Necesario para que las cookies funcionen en HF Spaces (proxy/iframe)
34
+ app.config.update(
35
+ SESSION_COOKIE_SAMESITE="None",
36
+ SESSION_COOKIE_SECURE=True,
37
+ SESSION_COOKIE_HTTPONLY=True,
38
+ )
39
+
40
  db = DatabaseManager()
41
  model = None
42
  CLASS_NAMES = ['Diabetic Retinopathy', 'No Diabetic Retinopathy']
 
698
  print("Cargando modelo de TensorFlow...")
699
  load_model()
700
  port = int(os.environ.get('PORT', 7860))
701
+ app.run(host='0.0.0.0', port=port, debug=False)