comparison mysite/settings/local.py @ 34:903260593491

Reworking settings.py to a settings package.
author Brian Neal <bgneal@gmail.com>
date Tue, 29 Nov 2011 03:14:25 +0000
parents
children b8e166ca993a
comparison
equal deleted inserted replaced
33:7d8015de651a 34:903260593491
1 """
2 Local Django settings for The Madeira site.
3 The contents of this file will vary depending on the local installation.
4
5 """
6 from settings.base import *
7
8 DATABASES = {
9 'default': {
10 'ENGINE': 'django.db.backends.mysql',
11 'NAME': 'madeira_django1_3',
12 'USER': SECRETS['DB_USER'],
13 'PASSWORD': SECRETS['DB_PASSWORD'],
14 },
15 }
16
17 # Django Debug Toolbar support
18 if DEBUG:
19 try:
20 import debug_toolbar
21 except ImportError:
22 pass
23 else:
24 i = MIDDLEWARE_CLASSES.index('django.middleware.common.CommonMiddleware')
25 MIDDLEWARE_CLASSES.insert(i + 1,
26 'debug_toolbar.middleware.DebugToolbarMiddleware')
27 INSTALLED_APPS.append('debug_toolbar')
28 DEBUG_TOOLBAR_CONFIG = {
29 'INTERCEPT_REDIRECTS': True,
30 }
31
32 # Logging configuration
33
34 LOGGING = {
35 'version': 1,
36 'disable_existing_loggers': True,
37 'formatters': {
38 'verbose': {
39 'format': '%(asctime)s %(levelname)s %(module)s %(process)d %(thread)d %(message)s'
40 },
41 'simple': {
42 'format': '%(asctime)s %(levelname)s %(message)s'
43 },
44 },
45 'handlers': {
46 'console': {
47 'class': 'logging.StreamHandler',
48 'level': 'DEBUG',
49 'formatter': 'simple',
50 },
51 'file': {
52 'class': 'logging.handlers.RotatingFileHandler',
53 'level': 'DEBUG',
54 'formatter': 'simple',
55 'filename': os.path.join(PROJECT_PATH, 'logs', 'madeira.log'),
56 'mode': 'a',
57 'maxBytes': 100 * 1024,
58 'backupCount': 10,
59 },
60 'mail_admins': {
61 'class': 'django.utils.log.AdminEmailHandler',
62 'level': 'ERROR',
63 'formatter': 'simple',
64 },
65 },
66 'loggers': {
67 'django':{
68 'level': 'WARNING',
69 'propagate': False,
70 'handlers': ['file'],
71 },
72 },
73 'root': {
74 'level': 'DEBUG',
75 'handlers': ['file'],
76 },
77 }