From 5cd2556bed1e4a6d96966554b066d2f9e40961fb Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 14 Feb 2020 16:15:04 +0100 Subject: Add Sentry integration --- example_project/settings.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'example_project/settings.py') diff --git a/example_project/settings.py b/example_project/settings.py index b858c5907..11013daad 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -6,6 +6,12 @@ import os import sys from importlib import import_module +try: + import sentry_sdk + from sentry_sdk.integrations.django import DjangoIntegration +except ImportError: + sentry_sdk = None + DEBUG = False DEBUG_TOOLBAR = False DEBUG_TO_CONSOLE = False @@ -286,8 +292,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 +398,10 @@ if 'test' in sys.argv: if not DEBUG: # persistent connection DATABASES['default']['CONN_MAX_AGE'] = 600 + +if SENTRY_ID and sentry_sdk: + sentry_sdk.init( + dsn=SENTRY_ID, + integrations=[DjangoIntegration()], + send_default_pii=True + ) -- cgit v1.2.3