From 4c05f118c5be9d914163903955d5220f1dfe8b49 Mon Sep 17 00:00:00 2001 From: Duncan Peacock Date: Tue, 15 Dec 2020 17:33:42 +0100 Subject: [PATCH 1/2] Move sentry dns to environment variable --- fragalysis/settings.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fragalysis/settings.py b/fragalysis/settings.py index 8f11d02c..fcff7729 100644 --- a/fragalysis/settings.py +++ b/fragalysis/settings.py @@ -32,10 +32,12 @@ # Should always be True on production. AUTHENTICATE_UPLOAD = True -if DEBUG == False: +# This is set on AWX when the fragalysis-stack is rebuilt. +SENTRY_DNS = os.environ.get("FRAGALYSIS_BACKEND_SENTRY_DNS") +if DEBUG is False and SENTRY_DNS: # By default only call sentry in staging/production sentry_sdk.init( - dsn="https://27fa0675f555431aa02ca552e93d8cfb@o194333.ingest.sentry.io/1298290", + dsn=SENTRY_DNS, integrations=[DjangoIntegration(), CeleryIntegration(), RedisIntegration()], # If you wish to associate users to errors (assuming you are using From 3aa4adb3acd5e254783a7390d5194a875d959381 Mon Sep 17 00:00:00 2001 From: Duncan Peacock Date: Wed, 16 Dec 2020 10:50:34 +0100 Subject: [PATCH 2/2] Fix debug --- fragalysis/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fragalysis/settings.py b/fragalysis/settings.py index fcff7729..089036af 100644 --- a/fragalysis/settings.py +++ b/fragalysis/settings.py @@ -18,7 +18,7 @@ from sentry_sdk.integrations.redis import RedisIntegration # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = False # These flags are used in the upload_tset form as follows. # Proposal Supported | Proposal Required | Proposal / View fields