"""Sentry Client. Provides sentry_client attribute for ad hoc capturing of messages and errors. https://docs.getsentry.com/hosted/clients/python/usage/ """ import raven from images import config def get_client(): """Return initialized Sentry client. If config.SENTRY is set, an initialized Sentry client is returned, if it is not set, a Client initialized with None is returned but nothing will be sent to Sentry. Returns: raven.Client: Sentry client that to capture messages and error. """ sentry_client = raven.Client(config.SENTRY) return sentry_client sentry_client = get_client()