Sentry integrated in Django

This commit is contained in:
Chneemann 2024-09-15 09:05:19 +02:00
parent 8f899d57a5
commit 8ff11ddc83
2 changed files with 15 additions and 0 deletions

View file

@ -28,6 +28,7 @@ python-decouple==3.8
redis==5.0.8 redis==5.0.8
requests==2.32.3 requests==2.32.3
rq==1.16.2 rq==1.16.2
sentry-sdk==2.14.0
setuptools==72.1.0 setuptools==72.1.0
six==1.16.0 six==1.16.0
sqlparse==0.5.1 sqlparse==0.5.1

View file

@ -13,6 +13,7 @@ https://docs.djangoproject.com/en/5.0/ref/settings/
import os import os
from pathlib import Path from pathlib import Path
from decouple import config from decouple import config
import sentry_sdk
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = Path(__file__).resolve().parent.parent
@ -219,3 +220,16 @@ AUTHENTICATION_BACKENDS = (
'auth.custom_backend.EmailBackend', 'auth.custom_backend.EmailBackend',
'django.contrib.auth.backends.ModelBackend', 'django.contrib.auth.backends.ModelBackend',
) )
# Sentry
sentry_sdk.init(
dsn="https://f9cac097dbb7a0d104f07d347e1bd470@o4507955559464960.ingest.de.sentry.io/4507955586138192",
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for tracing.
traces_sample_rate=1.0,
# Set profiles_sample_rate to 1.0 to profile 100%
# of sampled transactions.
# We recommend adjusting this value in production.
profiles_sample_rate=1.0,
)