From 848ea8f8c382ddf60fa2ff5a1ab467d18567f495 Mon Sep 17 00:00:00 2001 From: Herman Schechkin Date: Sun, 16 Jan 2022 00:39:46 +0300 Subject: [PATCH] Added sentry --- project/settings.py | 10 ++++++++++ requirements.txt | 1 + 2 files changed, 11 insertions(+) diff --git a/project/settings.py b/project/settings.py index 045ca23..c69ef30 100644 --- a/project/settings.py +++ b/project/settings.py @@ -5,6 +5,9 @@ from distutils.util import strtobool from pathlib import Path +import sentry_sdk +from sentry_sdk.integrations.django import DjangoIntegration + EASY_RUN_MODE = False # Variable for fast project start without dealing with environment variables if EASY_RUN_MODE: os.environ['DEBUG'] = 'True' @@ -223,3 +226,10 @@ def clear_temporary_images_folder(): if DEBUG or IN_TESTING: CACHES['default'] = CACHE_LOCMEM + +sentry_sdk.init( + dsn=os.getenv('SENTRY_DSN', ''), + integrations=[DjangoIntegration()], + traces_sample_rate=1.0, + send_default_pii=False +) diff --git a/requirements.txt b/requirements.txt index 57d4440..ef25927 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,6 +21,7 @@ pyflakes==2.3.1 python-memcached==1.59 pytz==2020.1 requests==2.24.0 +sentry-sdk==1.5.2 six==1.15.0 sqlparse==0.4.1 toml==0.10.2