Spaces:
Sleeping
Sleeping
Change Flask app port configuration and disable debug
Browse filesUpdated the Flask app to use environment variable for port and disabled debug mode.
app.py
CHANGED
|
@@ -490,8 +490,8 @@ if __name__ == '__main__':
|
|
| 490 |
print("🔗 Access the application at: http://localhost:5000")
|
| 491 |
print("💡 Using rule-based question generation for faster startup")
|
| 492 |
print("⚡ System will initialize on first use")
|
| 493 |
-
|
| 494 |
# Configure Flask for better timeout handling
|
| 495 |
app.config['PERMANENT_SESSION_LIFETIME'] = 1800 # 30 minutes
|
| 496 |
|
| 497 |
-
|
|
|
|
|
|
| 490 |
print("🔗 Access the application at: http://localhost:5000")
|
| 491 |
print("💡 Using rule-based question generation for faster startup")
|
| 492 |
print("⚡ System will initialize on first use")
|
|
|
|
| 493 |
# Configure Flask for better timeout handling
|
| 494 |
app.config['PERMANENT_SESSION_LIFETIME'] = 1800 # 30 minutes
|
| 495 |
|
| 496 |
+
port = int(os.environ.get("PORT", 7860)) # HF uses 7860
|
| 497 |
+
app.run(host="0.0.0.0", port=port, debug=False)
|