From ac84aeedfb1f62dde9075dc05f2fb0c5e6354bbf Mon Sep 17 00:00:00 2001 From: Harris Tzovanakis Date: Wed, 31 Jul 2024 09:28:58 +0200 Subject: [PATCH] backend: add sentry debug on DEV env --- backoffice/config/urls.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backoffice/config/urls.py b/backoffice/config/urls.py index db2635c0..a35561e6 100644 --- a/backoffice/config/urls.py +++ b/backoffice/config/urls.py @@ -42,6 +42,11 @@ path("api/token/refresh/", TokenRefreshView.as_view(), name="token_refresh"), ] + +def sentry_trigger_error(request): + division_by_zero = 1 / 0 # noqa + + if settings.DEBUG: # This allows the error pages to be debugged during development, just visit # these url in browser to see how these error pages look like. @@ -62,7 +67,9 @@ kwargs={"exception": Exception("Page not Found")}, ), path("500/", default_views.server_error), + path("sentry-debug/", sentry_trigger_error), ] + if "debug_toolbar" in settings.INSTALLED_APPS: import debug_toolbar