Adding sentry to monitor errors

This commit is contained in:
2020-11-08 16:05:05 -03:00
parent fc10a32d7e
commit a78f7b9882
2 changed files with 16 additions and 1 deletions

View File

@@ -1,11 +1,23 @@
import os
from pathlib import Path
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
SCOPE = os.getenv("SCOPE", "production")
sentry_sdk.init(
dsn=os.getenv("SENTRY_DSN"),
integrations=[DjangoIntegration()],
environment=SCOPE,
send_default_pii=False,
traces_sample_rate=1.0,
)
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.getenv("SECRET_KEY", "changeme")