From aaa0f8625d3a111ccbb7b95722ba5e134352371d Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Thu, 23 Apr 2020 13:52:24 -0400 Subject: [PATCH] Silence disallowed host errors (to avoid unnecessary Sentry notifications) --- ocdstoucan/settings.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ocdstoucan/settings.py b/ocdstoucan/settings.py index 23cedcf..19b6638 100644 --- a/ocdstoucan/settings.py +++ b/ocdstoucan/settings.py @@ -140,6 +140,22 @@ ('es', _('Spanish')), ] +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'handlers': { + 'null': { + 'class': 'logging.NullHandler', + }, + }, + 'loggers': { + 'django.security.DisallowedHost': { + 'handlers': ['null'], + 'propagate': False, + }, + }, +} + OCDS_TOUCAN_MAXNUMFILES = os.getenv('OCDS_TOUCAN_MAXNUMFILES', 20) OCDS_TOUCAN_MAXFILESIZE = os.getenv('OCDS_TOUCAN_MAXFILESIZE', 10000000) # in bytes