Mercurial > public > bravenewsurf
diff bns_website/settings/local.py @ 1:134fbfc4acf6
Restructured settings as a directory to allow for different settings files. E.g.
python manage.py runserver --settings=settings.local
Load secret/sensitive information from settings/secrets.json, which will not be controlled in source control.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 27 Oct 2011 20:01:37 -0500 |
parents | |
children | 48ff23eab86a |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bns_website/settings/local.py Thu Oct 27 20:01:37 2011 -0500 @@ -0,0 +1,56 @@ +# Django local settings for bns_website project. + +from settings.base import * + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +MEDIA_URL = '/media/' +STATIC_URL = '/static/' +ADMIN_MEDIA_PREFIX = '/static/admin/' + + +LOGGING = { + 'version': 1, + 'disable_existing_loggers': True, + 'formatters': { + 'verbose': { + 'format': '%(asctime)s %(levelname)s %(module)s %(process)d %(thread)d %(message)s' + }, + 'simple': { + 'format': '%(asctime)s %(levelname)s %(message)s' + }, + }, + 'handlers': { + 'console': { + 'class': 'logging.StreamHandler', + 'level': 'DEBUG', + 'formatter': 'simple', + }, + 'file': { + 'class': 'logging.handlers.RotatingFileHandler', + 'level': 'DEBUG', + 'formatter': 'simple', + 'filename': os.path.join(PROJECT_PATH, 'logs', 'bns.log'), + 'mode': 'a', + 'maxBytes': 100 * 1024, + 'backupCount': 10, + }, + 'mail_admins': { + 'class': 'django.utils.log.AdminEmailHandler', + 'level': 'ERROR', + 'formatter': 'simple', + }, + }, + 'loggers': { + 'django':{ + 'level': 'WARNING', + 'propagate': False, + 'handlers': ['file'], + }, + }, + 'root': { + 'level': 'DEBUG', + 'handlers': ['file'], + }, +}