From b2f8fe3ed5fa60075eae8dcf1f7b434c5ed9f2eb Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Fri, 15 Jul 2022 12:10:10 +0200 Subject: [PATCH] Reorder imports because sentry is an optional dep --- examples/app.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/app.py b/examples/app.py index 3a6a25a6..47671ec9 100644 --- a/examples/app.py +++ b/examples/app.py @@ -3,11 +3,8 @@ Example app with minimal configuration. Use this as a starting point. """ -import sentry_sdk -from decouple import config -# from flask_wtf.csrf import CSRFProtect -from sentry_sdk.integrations.flask import FlaskIntegration +from decouple import config from ereuse_devicehub.api.views import api from ereuse_devicehub.config import DevicehubConfig @@ -17,11 +14,17 @@ from ereuse_devicehub.labels.views import labels from ereuse_devicehub.views import core from ereuse_devicehub.workbench.views import workbench +# from flask_wtf.csrf import CSRFProtect + + # from werkzeug.contrib.profiler import ProfilerMiddleware SENTRY_DSN = config('SENTRY_DSN', None) if SENTRY_DSN: + import sentry_sdk + from sentry_sdk.integrations.flask import FlaskIntegration + sentry_sdk.init( dsn=SENTRY_DSN, integrations=[