To_DO: ERROR AFTER LOGGING IN

This commit is contained in:
florianuhlig
2025-10-03 15:03:18 +02:00
parent 70c85cb8be
commit 1554723ed4
27 changed files with 1484 additions and 273 deletions

30
main.py
View File

@@ -1,12 +1,28 @@
import sqlLite
import logging
import os
from frontend.app import app
sqlLite.set_db_name("databases/test.db")
# Logging konfigurieren
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
import sqlLite.create as create
create.create_table_t_user()
logger = logging.getLogger(__name__)
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=8080)
# Environment-Konfiguration
debug = os.getenv('FLASK_DEBUG', 'False').lower() == 'true'
host = os.getenv('FLASK_HOST', '0.0.0.0')
port = int(os.getenv('FLASK_PORT', '8080'))
logger.info(f"Starting ChatBot application on {host}:{port}")
logger.info(f"Debug mode: {debug}")
try:
app.run(debug=debug, host=host, port=port)
except KeyboardInterrupt:
logger.info("Application stopped by user")
except Exception as e:
logger.error(f"Application failed to start: {e}")
raise