diff options
author | Dan McGee <dan@archlinux.org> | 2012-08-13 09:38:47 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-08-13 21:24:40 -0500 |
commit | aa7f51e6bd80fded21fabf3135ebe78ff32b24c7 (patch) | |
tree | 9c4750ea3172bb7411df63a966ee013371d4b330 /settings.py | |
parent | 5549b119ea84ffd60f2987610ae35fb393d9625e (diff) |
Enable rate-limiting log filter
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'settings.py')
-rw-r--r-- | settings.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/settings.py b/settings.py index 8b74e554..80df6f43 100644 --- a/settings.py +++ b/settings.py @@ -78,6 +78,7 @@ MIDDLEWARE_CLASSES = ( 'django.middleware.doc.XViewMiddleware', ) +# Base of the URL hierarchy ROOT_URLCONF = 'urls' # URL to serve static files @@ -123,6 +124,31 @@ INSTALLED_APPS = ( 'retro', ) +# Logging configuration for not getting overspammed +LOGGING = { + 'version': 1, + 'filters': { + 'ratelimit': { + '()': 'main.log.RateLimitFilter', + } + }, + 'handlers': { + 'mail_admins': { + 'level': 'ERROR', + 'filters': ['ratelimit'], + 'class': 'django.utils.log.AdminEmailHandler', + } + }, + 'loggers': { + 'django.request': { + 'handlers': ['mail_admins'], + 'level': 'ERROR', + 'propagate': True, + }, + }, +} + + ## Server used for linking to PGP keysearch results PGP_SERVER = 'pgp.mit.edu:11371' |