"""Application.""" import ddtrace from socials import config if config.ENVIRONMENT not in (config.QA_ENVIRONMENT, config.PROD_ENVIRONMENT): ddtrace.tracer.enabled = False # patch as soon as possible to ensure modules report to datadog apm ddtrace.patch_all(futures=True, httplib=True, sqlalchemy=True) # noqa from raven.contrib import flask from socials import api from socials import config from socials import handlers # noqa if config.SENTRY: api.app.config['SENTRY_DSN'] = config.SENTRY flask.Sentry(api.app) app = api.app