bgneal@499
|
1 """
|
bgneal@499
|
2 Local Django settings.
|
bgneal@499
|
3
|
bgneal@499
|
4 """
|
bgneal@581
|
5 from sg101.settings.base import *
|
bgneal@499
|
6
|
bgneal@499
|
7 DATABASES = {
|
bgneal@499
|
8 'default': {
|
bgneal@499
|
9 'ENGINE': 'django.db.backends.mysql',
|
bgneal@569
|
10 'NAME': SECRETS['DB_NAME'],
|
bgneal@499
|
11 'USER': SECRETS['DB_USER'],
|
bgneal@499
|
12 'PASSWORD': SECRETS['DB_PASSWORD'],
|
bgneal@877
|
13 'OPTIONS': {
|
bgneal@877
|
14 'unix_socket': '/var/run/mysqld/mysqld.sock',
|
bgneal@877
|
15 },
|
bgneal@499
|
16 },
|
bgneal@499
|
17 }
|
bgneal@499
|
18
|
bgneal@628
|
19 WIKI_COOKIE_DOMAIN = None
|
bgneal@628
|
20
|
bgneal@499
|
21 # Django Debug Toolbar support
|
bgneal@499
|
22 if DEBUG:
|
bgneal@499
|
23 try:
|
bgneal@499
|
24 import debug_toolbar
|
bgneal@499
|
25 except ImportError:
|
bgneal@499
|
26 pass
|
bgneal@499
|
27 else:
|
bgneal@499
|
28 i = MIDDLEWARE_CLASSES.index('django.middleware.common.CommonMiddleware')
|
bgneal@499
|
29 MIDDLEWARE_CLASSES.insert(i + 1,
|
bgneal@499
|
30 'debug_toolbar.middleware.DebugToolbarMiddleware')
|
bgneal@499
|
31 INSTALLED_APPS.append('debug_toolbar')
|
bgneal@499
|
32 DEBUG_TOOLBAR_CONFIG = {
|
bgneal@926
|
33 'DISABLE_PANELS': set(),
|
bgneal@926
|
34 'JQUERY_URL': '',
|
bgneal@499
|
35 }
|
bgneal@499
|
36
|
bgneal@499
|
37 # Logging configuration
|
bgneal@499
|
38
|
bgneal@499
|
39 LOGGING = {
|
bgneal@499
|
40 'version': 1,
|
bgneal@499
|
41 'disable_existing_loggers': True,
|
bgneal@499
|
42 'formatters': {
|
bgneal@499
|
43 'verbose': {
|
bgneal@499
|
44 'format': '%(asctime)s %(levelname)s %(module)s %(process)d %(thread)d %(message)s'
|
bgneal@499
|
45 },
|
bgneal@499
|
46 'simple': {
|
bgneal@499
|
47 'format': '%(asctime)s %(levelname)s %(message)s'
|
bgneal@499
|
48 },
|
bgneal@499
|
49 },
|
bgneal@571
|
50 'filters': {
|
bgneal@571
|
51 'require_debug_false': {
|
bgneal@571
|
52 '()': 'django.utils.log.RequireDebugFalse'
|
bgneal@571
|
53 },
|
bgneal@571
|
54 },
|
bgneal@499
|
55 'handlers': {
|
bgneal@499
|
56 'console': {
|
bgneal@499
|
57 'class': 'logging.StreamHandler',
|
bgneal@499
|
58 'level': 'DEBUG',
|
bgneal@499
|
59 'formatter': 'simple',
|
bgneal@499
|
60 },
|
bgneal@499
|
61 'file': {
|
bgneal@499
|
62 'class': 'logging.handlers.RotatingFileHandler',
|
bgneal@499
|
63 'level': 'DEBUG',
|
bgneal@499
|
64 'formatter': 'simple',
|
bgneal@499
|
65 'filename': os.path.join(PROJECT_PATH, 'logs', 'sg101.log'),
|
bgneal@499
|
66 'mode': 'a',
|
bgneal@499
|
67 'maxBytes': 100 * 1024,
|
bgneal@499
|
68 'backupCount': 10,
|
bgneal@737
|
69 'encoding': 'utf-8',
|
bgneal@499
|
70 },
|
bgneal@690
|
71 'auth': {
|
bgneal@690
|
72 'class': 'logging.handlers.RotatingFileHandler',
|
bgneal@690
|
73 'level': 'DEBUG',
|
bgneal@690
|
74 'formatter': 'simple',
|
bgneal@690
|
75 'filename': os.path.join(PROJECT_PATH, 'logs', 'auth.log'),
|
bgneal@690
|
76 'mode': 'a',
|
bgneal@690
|
77 'maxBytes': 2 * 1024 * 1024,
|
bgneal@690
|
78 'backupCount': 5,
|
bgneal@737
|
79 'encoding': 'utf-8',
|
bgneal@690
|
80 },
|
bgneal@499
|
81 'mail_admins': {
|
bgneal@499
|
82 'class': 'django.utils.log.AdminEmailHandler',
|
bgneal@499
|
83 'level': 'ERROR',
|
bgneal@499
|
84 'formatter': 'simple',
|
bgneal@571
|
85 'filters': ['require_debug_false'],
|
bgneal@499
|
86 },
|
bgneal@499
|
87 },
|
bgneal@499
|
88 'loggers': {
|
bgneal@690
|
89 'django': {
|
bgneal@499
|
90 'level': 'WARNING',
|
bgneal@499
|
91 'propagate': False,
|
bgneal@499
|
92 'handlers': ['file'],
|
bgneal@499
|
93 },
|
bgneal@690
|
94 'auth': {
|
bgneal@690
|
95 'level': 'DEBUG',
|
bgneal@690
|
96 'propagate': False,
|
bgneal@690
|
97 'handlers': ['auth'],
|
bgneal@690
|
98 },
|
bgneal@861
|
99 'MARKDOWN': {
|
bgneal@861
|
100 'level': 'WARNING',
|
bgneal@861
|
101 'propagate': False,
|
bgneal@861
|
102 'handlers': ['file'],
|
bgneal@861
|
103 },
|
bgneal@499
|
104 },
|
bgneal@499
|
105 'root': {
|
bgneal@499
|
106 'level': 'DEBUG',
|
bgneal@499
|
107 'handlers': ['file'],
|
bgneal@499
|
108 },
|
bgneal@499
|
109 }
|