Created
February 13, 2022 19:17
-
-
Save sanjmen/7c2fbf814ff31de6d3f9f27568c22440 to your computer and use it in GitHub Desktop.
Sentry settings for django app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sentry related config vars | |
SENTRY_ENABLED = env.bool("SENTRY_ENABLED", default=False) | |
SENTRY_DSN = env("SENTRY_DSN", default="") | |
SENTRY_ENVIRONMENT = env("SENTRY_ENVIRONMENT", default="staging") | |
if SENTRY_ENABLED: | |
import sentry_sdk | |
from sentry_sdk.integrations.django import DjangoIntegration | |
from sentry_sdk.integrations.celery import CeleryIntegration | |
sentry_sdk.init( | |
environment=f"{SENTRY_ENVIRONMENT}", | |
dsn=f"{SENTRY_DSN}", | |
integrations=[DjangoIntegration(), CeleryIntegration()], | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment