|
54 | 54 | # Examples: "http://foo.com/media/", "/media/". |
55 | 55 | ADMIN_MEDIA_PREFIX = '/static/admin/' |
56 | 56 |
|
57 | | -# Make this unique, and don't share it with anybody. |
58 | | -SECRET_KEY = 'as%n_m#)^vee2pe91^^@c))sl7^c6t-9r8n)_69%)2yt+(la2&' |
| 57 | +with open(os.path.join(BASEDIR, 'secret_key')) as f: |
| 58 | + SECRET_KEY = f.read().strip() |
59 | 59 |
|
60 | 60 | # List of callables that know how to import templates from various sources. |
61 | 61 | TEMPLATE_LOADERS = ( |
@@ -83,7 +83,7 @@ def process_exception(self, request, exception): |
83 | 83 | (request.build_absolute_uri(), |
84 | 84 | traceback.format_exc())) |
85 | 85 | # And add it to the middleware classes |
86 | | - MIDDLEWARE_CLASSES += ('sample_project.settings.LogUncatchedErrors',) |
| 86 | + MIDDLEWARE_CLASSES += ('speed_python.settings.LogUncatchedErrors',) |
87 | 87 |
|
88 | 88 | # set shown level of logging output to debug |
89 | 89 | logging.basicConfig(level=logging.DEBUG) |
@@ -112,6 +112,7 @@ def process_exception(self, request, exception): |
112 | 112 | 'django.contrib.staticfiles', |
113 | 113 | 'codespeed', |
114 | 114 | 'south', |
| 115 | + 'gunicorn', |
115 | 116 | ) |
116 | 117 | SOUTH_TESTS_MIGRATE = False |
117 | 118 |
|
@@ -187,3 +188,57 @@ def process_exception(self, request, exception): |
187 | 188 | #DEF_BRANCH = "default" # Defines the default branch to be used. |
188 | 189 | # In git projects, this branch is usually be calles |
189 | 190 | # "master" |
| 191 | + |
| 192 | +# FIXME: Copied from Django docs (and pared down a bit) |
| 193 | +# This is just enough to make gunicorn happy |
| 194 | +LOGGING = { |
| 195 | + 'version': 1, |
| 196 | + 'disable_existing_loggers': True, |
| 197 | + 'formatters': { |
| 198 | + 'verbose': { |
| 199 | + 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' |
| 200 | + }, |
| 201 | + 'simple': { |
| 202 | + 'format': '%(levelname)s %(message)s' |
| 203 | + }, |
| 204 | + }, |
| 205 | + # 'filters': { |
| 206 | + # 'special': { |
| 207 | + # '()': 'project.logging.SpecialFilter', |
| 208 | + # 'foo': 'bar', |
| 209 | + # } |
| 210 | + # }, |
| 211 | + 'handlers': { |
| 212 | + 'null': { |
| 213 | + 'level': 'DEBUG', |
| 214 | + 'class': 'django.utils.log.NullHandler', |
| 215 | + }, |
| 216 | + 'console': { |
| 217 | + 'level': 'DEBUG', |
| 218 | + 'class': 'logging.StreamHandler', |
| 219 | + 'formatter': 'simple' |
| 220 | + }, |
| 221 | + 'mail_admins': { |
| 222 | + 'level': 'ERROR', |
| 223 | + 'class': 'django.utils.log.AdminEmailHandler', |
| 224 | + # 'filters': ['special'] |
| 225 | + } |
| 226 | + }, |
| 227 | + 'loggers': { |
| 228 | + 'django': { |
| 229 | + 'handlers': ['null'], |
| 230 | + 'propagate': True, |
| 231 | + 'level': 'INFO', |
| 232 | + }, |
| 233 | + 'django.request': { |
| 234 | + 'handlers': ['mail_admins'], |
| 235 | + 'level': 'ERROR', |
| 236 | + 'propagate': False, |
| 237 | + }, |
| 238 | +# 'myproject.custom': { |
| 239 | +# 'handlers': ['console', 'mail_admins'], |
| 240 | +# 'level': 'INFO', |
| 241 | +# 'filters': ['special'] |
| 242 | +# } |
| 243 | + } |
| 244 | +} |
0 commit comments