Skip to content
Snippets Groups Projects
Commit ee52efde authored by Tobias Mieves's avatar Tobias Mieves :sparkles:
Browse files

chore: Add optional sentry error reporting

Exceptions are reported to sentry if the environment variable ERROR_REPORTING is set to True. If it is set to false or not set, no data is sent to sentry
parent 7eff2886
No related branches found
No related tags found
2 merge requests!44Main,!43chore: Add optional sentry error reporting
Pipeline #261206 passed with warnings
......@@ -12,6 +12,8 @@ https://docs.djangoproject.com/en/4.1/ref/settings/
from os import environ
from pathlib import Path
import sentry_sdk
env = environ
# Build paths inside the project like this: BASE_DIR / 'subdir'.
......@@ -137,3 +139,13 @@ EMAIL_HOST = env.get("EMAIL_HOST")
EMAIL_HOST_USER = env.get("EMAIL_USER")
EMAIL_HOST_PASSWORD = env.get("EMAIL_PASSWORD")
DEFAULT_FROM_EMAIL = env.get("FROM_EMAIL")
ERROR_REPORTING = env.get("ERROR_REPORTING", False)
if ERROR_REPORTING and not DEBUG:
sentry_sdk.init(
dsn="https://1ea494bd0994743aed627c8dbf46183b@o4508272990093312.ingest.de.sentry.io/4508295867990096",
# of transactions for tracing.
traces_sample_rate=1.0, _experiments={ # Set continuous_profiling_auto_start to True
# to automatically start the profiler on when
# possible.
"continuous_profiling_auto_start": True, }, )
Django==5.0.6
whitenoise==6.6.0
gunicorn==22.0.0
sentry-sdk[django]==2.18.0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment