- Add optional sentry integration
This commit is contained in:
Sonny 2020-06-28 20:42:09 +02:00
parent 2be35bce53
commit 1993338120
3 changed files with 45 additions and 1 deletions

View file

@ -49,3 +49,16 @@ TEMPLATES = [
AXES_HANDLER = "axes.handlers.database.AxesDatabaseHandler"
REGISTRATION_OPEN = False
# Optionally use sentry integration
try:
from sentry_sdk import init as sentry_init
from sentry_sdk.integrations.django import CeleryIntegration, DjangoIntegration
sentry_init(
dsn=os.environ.get("SENTRY_DSN"),
integrations=[DjangoIntegration(), CeleryIntegration()],
send_default_pii=False,
)
except ImportError:
pass