summaryrefslogtreecommitdiff
path: root/example_project/settings.py
diff options
context:
space:
mode:
Diffstat (limited to 'example_project/settings.py')
-rw-r--r--example_project/settings.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/example_project/settings.py b/example_project/settings.py
index b858c5907..a5d1d3b3e 100644
--- a/example_project/settings.py
+++ b/example_project/settings.py
@@ -6,6 +6,13 @@ import os
import sys
from importlib import import_module
+try:
+ import sentry_sdk
+ from sentry_sdk.integrations.celery import CeleryIntegration
+ from sentry_sdk.integrations.django import DjangoIntegration
+except ImportError:
+ sentry_sdk = None
+
DEBUG = False
DEBUG_TOOLBAR = False
DEBUG_TO_CONSOLE = False
@@ -286,8 +293,8 @@ MAX_UPLOAD_SIZE = 100 # in Mo
DOT_BINARY = "/usr/bin/dot"
TEST_RUNNER = 'ishtar_common.tests.ManagedModelTestRunner'
-
CELERY_BROKER_URL = ''
+SENTRY_ID = None
try:
from local_settings import *
@@ -392,3 +399,13 @@ if 'test' in sys.argv:
if not DEBUG:
# persistent connection
DATABASES['default']['CONN_MAX_AGE'] = 600
+
+if SENTRY_ID and sentry_sdk:
+ sentry_integrations = [DjangoIntegration()]
+ if USE_BACKGROUND_TASK:
+ sentry_integrations.append(CeleryIntegration())
+ sentry_sdk.init(
+ dsn=SENTRY_ID,
+ integrations=sentry_integrations,
+ send_default_pii=True
+ )