From ee52efdeedf3f829195eec231666befc39486cf0 Mon Sep 17 00:00:00 2001 From: Tobias Mieves <tobias.mieves@tu-dortmund.de> Date: Thu, 14 Nov 2024 15:56:33 +0100 Subject: [PATCH 1/4] 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 --- core/settings.py | 12 ++++++++++++ requirements.txt | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/core/settings.py b/core/settings.py index 912e93d..8d9a8be 100644 --- a/core/settings.py +++ b/core/settings.py @@ -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, }, ) diff --git a/requirements.txt b/requirements.txt index 5d9ea5c..160c5c5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ Django==5.0.6 whitenoise==6.6.0 -gunicorn==22.0.0 \ No newline at end of file +gunicorn==22.0.0 +sentry-sdk[django]==2.18.0 -- GitLab From 3f26ac05f4a18bf0a7831ce7dacbe96828885d07 Mon Sep 17 00:00:00 2001 From: renovate-bot <renovate@fachschaften.org> Date: Mon, 11 Nov 2024 00:41:02 +0000 Subject: [PATCH 2/4] chore(deps): update dependency django to v5.1.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f7d7537..954f6d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Django==5.1.2 +Django==5.1.3 whitenoise==6.7.0 gunicorn==22.0.0 sentry-sdk[django]==2.18.0 -- GitLab From 106bc8213308b1ea83a3c67c728dd32ebf345c87 Mon Sep 17 00:00:00 2001 From: renovate-bot <renovate@fachschaften.org> Date: Mon, 12 Aug 2024 02:25:39 +0200 Subject: [PATCH 3/4] chore(deps): update dependency gunicorn to v23 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 954f6d1..5090939 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ Django==5.1.3 whitenoise==6.7.0 -gunicorn==22.0.0 +gunicorn==23.0.0 sentry-sdk[django]==2.18.0 -- GitLab From 64aa64af4fb58cff67e662beb414bd831c2870bb Mon Sep 17 00:00:00 2001 From: renovate-bot <renovate@fachschaften.org> Date: Mon, 4 Nov 2024 01:41:09 +0100 Subject: [PATCH 4/4] chore(deps): update dependency whitenoise to v6.8.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5090939..9d59c12 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ Django==5.1.3 -whitenoise==6.7.0 +whitenoise==6.8.2 gunicorn==23.0.0 sentry-sdk[django]==2.18.0 -- GitLab