Skip to content
Snippets Groups Projects
Commit 1121c701 authored by Tomáš Valenta's avatar Tomáš Valenta
Browse files

add Sentry integration

parent 990b25f3
No related branches found
No related tags found
1 merge request!6Release - fixed __str__, add hint
Pipeline #12965 failed
...@@ -15,6 +15,9 @@ import pathlib ...@@ -15,6 +15,9 @@ import pathlib
import dj_database_url import dj_database_url
import environ import environ
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = pathlib.Path(__file__).parents[2] BASE_DIR = pathlib.Path(__file__).parents[2]
...@@ -229,6 +232,17 @@ CLAMD_TCP_SOCKET = env.int("CLAMD_TCP_SOCKET") ...@@ -229,6 +232,17 @@ CLAMD_TCP_SOCKET = env.int("CLAMD_TCP_SOCKET")
CLAMD_TCP_ADDR = env.str("CLAMD_TCP_ADDR") CLAMD_TCP_ADDR = env.str("CLAMD_TCP_ADDR")
# Sentry
SENTRY_DSN = env.str("SENTRY_DSN")
if SENTRY_DSN is not None:
sentry_sdk.init(
dsn=SENTRY_DSN,
integrations=[DjangoIntegration()],
send_default_pii=True,
)
## App-specific ## App-specific
DEFAULT_CONTRACTEE_NAME = env.str("DEFAULT_CONTRACTEE_NAME") DEFAULT_CONTRACTEE_NAME = env.str("DEFAULT_CONTRACTEE_NAME")
......
gunicorn==20.1.0 gunicorn==20.1.0
whitenoise==6.3.0 whitenoise==6.3.0
sentry-sdk==1.24.0
...@@ -4,4 +4,4 @@ class NameStrMixin: ...@@ -4,4 +4,4 @@ class NameStrMixin:
raise NotImplementedError raise NotImplementedError
def __str__(self) -> str: def __str__(self) -> str:
return self.name return str(self.name)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment