06/03 Optimize app
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user