06/03 Optimize app

This commit is contained in:
2026-06-03 16:43:39 -04:00
parent 3990a01079
commit 3abd073437
9 changed files with 36 additions and 6 deletions
+13
View File
@@ -78,6 +78,19 @@ def create_app(config_name=None):
csrf.init_app(app)
limiter.init_app(app)
# ── Sentry (optional) ────────────────────────────────────────────────────
sentry_dsn = app.config.get('SENTRY_DSN', '')
if sentry_dsn:
import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration
sentry_sdk.init(
dsn=sentry_dsn,
integrations=[FlaskIntegration()],
traces_sample_rate=0.1, # 10 % of requests traced
send_default_pii=False, # no personal data in error reports
)
logging.getLogger('app').info('Sentry initialised')
from app.routes.auth import auth_bp
from app.routes.dashboard import dashboard_bp
from app.routes.accounts import accounts_bp