Changeset - 146377454d45
[Not reviewed]
0 1 0
Brett Smith - 5 years ago 2019-09-30 15:19:54
brettcsmith@brettcsmith.org
settings: Add a console logger.
1 file changed with 9 insertions and 3 deletions:
0 comments (0 inline, 0 general)
pinaxcon/settings.py
Show inline comments
...
 
@@ -216,69 +216,75 @@ INSTALLED_APPS = [
 
    "pinaxcon.proposals",
 
    "pinaxcon.registrasion",
 

	
 
    #testing
 
    "django_nose",
 

	
 
    # wiki
 
    'django.contrib.humanize',
 
    'django_nyt',
 
    'mptt',
 
    'sekizai',
 
    #'sorl.thumbnail',
 
    'wiki',
 
    'wiki.plugins.attachments',
 
    'wiki.plugins.notifications',
 
    #'wiki.plugins.images',
 
    'wiki.plugins.macros',
 

	
 
    # stylesheets and js
 
    'compressor',
 

	
 
    'email_log',
 
]
 

	
 
# A sample logging configuration. The only tangible logging
 
# performed by this configuration is to send an email to
 
# the site admins on every HTTP 500 error when DEBUG=False.
 
# A sample logging configuration.
 
# See http://docs.djangoproject.com/en/dev/topics/logging for
 
# more details on how to customize your logging configuration.
 
LOGGING = {
 
    "version": 1,
 
    "disable_existing_loggers": False,
 
    "filters": {
 
        "require_debug_false": {
 
            "()": "django.utils.log.RequireDebugFalse"
 
        }
 
    },
 
    "handlers": {
 
        'console': {
 
            'level': os.environ.get('DJANGO_LOG_LEVEL', 'WARNING'),
 
            'class': 'logging.StreamHandler',
 
        },
 
        "mail_admins": {
 
            "level": "ERROR",
 
            "filters": ["require_debug_false"],
 
            "class": "django.utils.log.AdminEmailHandler"
 
        }
 
    },
 
    "loggers": {
 
        'django': {
 
            'handlers': ['console'],
 
            'propagate': True,
 
        },
 
        "django.request": {
 
            "handlers": ["mail_admins"],
 
            "level": "ERROR",
 
            "propagate": True,
 
        },
 
    }
 
}
 

	
 
COMPRESS_PRECOMPILERS = (
 
    ('text/x-scss', 'django_libsass.SassCompiler'),
 
)
 

	
 
FIXTURE_DIRS = [
 
    os.path.join(PROJECT_ROOT, "fixtures"),
 
]
 

	
 
# Heroku: Get email configuration from environment variables.
 

	
 
EMAIL_BACKEND = "email_log.backends.EmailBackend"
 
EMAIL_LOG_BACKEND = os.environ.get("DJANGO_EMAIL_BACKEND", "django.core.mail.backends.console.EmailBackend")  # noqa
 
EMAIL_HOST = os.environ.get("DJANGO_EMAIL_HOST", "")
 
EMAIL_PORT = int(os.environ.get("DJANGO_EMAIL_PORT", 25))
 
EMAIL_HOST_USER = os.environ.get("DJANGO_EMAIL_HOST_USER", "")
 
EMAIL_HOST_PASSWORD = os.environ.get("DJANGO_EMAIL_HOST_PASSWORD", "")
0 comments (0 inline, 0 general)