From 26e03c26fc214481d82e407439feeeab8c27e49f Mon Sep 17 00:00:00 2001 From: virusdefender Date: Tue, 26 Mar 2019 09:47:58 +0800 Subject: [PATCH] disable sentry in no production env --- oj/settings.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/oj/settings.py b/oj/settings.py index 37a8585..61a1316 100644 --- a/oj/settings.py +++ b/oj/settings.py @@ -26,17 +26,21 @@ with open(os.path.join(DATA_DIR, "config", "secret.key"), "r") as f: BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Applications -VENDOR_APPS = ( +VENDOR_APPS = [ 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.contenttypes', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', - 'raven.contrib.django.raven_compat', 'django_dramatiq', -) -LOCAL_APPS = ( +] + +if production_env: + VENDOR_APPS.append('raven.contrib.django.raven_compat') + + +LOCAL_APPS = [ 'account', 'announcement', 'conf', @@ -46,7 +50,7 @@ LOCAL_APPS = ( 'submission', 'options', 'judge', -) +] INSTALLED_APPS = VENDOR_APPS + LOCAL_APPS