-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsettings.py
108 lines (89 loc) · 2.9 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
"""
Django settings for dbs project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
from __future__ import absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement
# localsettings is used to store site depandant settings
from .site_settings import (
SECRET_KEY, ALLOWED_HOSTS, DATABASES,
DEBUG, DBDEBUG, TEMPLATE_DEBUG,
ADMINS, MANAGERS, SERVER_EMAIL,
LANGUAGE_CODE, TIME_ZONE, LANGUAGES,
MEDIA_ROOT, MEDIA_URL, STATIC_ROOT, STATIC_URL,
BROKER_URL, CELERY_RESULT_BACKEND, CELERY_TIMEZONE,
)
# Application definition
from django.conf import global_settings
TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
'django.core.context_processors.request',
)
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# django-simple-menu
'menu',
'dbs',
'dbs.api',
'dbs.web',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'dbs.urls'
WSGI_APPLICATION = 'dbs.wsgi.application'
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'console':{
'level': 'DEBUG',
'class': 'logging.StreamHandler',
},
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler',
}
},
'loggers': {
'': {
'handlers': DEBUG and ['console'] or ['console', 'mail_admins'],
'level': DEBUG and 'DEBUG' or 'INFO',
'propagate': True,
},
'django.request': {
'handlers': ['console', 'mail_admins'],
'level': 'ERROR',
'propagate': True,
},
'django.db.backends': {
'level': DBDEBUG and 'DEBUG' or 'INFO',
'propagate': True,
},
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Celery configuration
BROKER_TRANSPORT_OPTIONS = {'fanout_prefix': True}
BROKER_TRANSPORT_OPTIONS = {'fanout_patterns': True}
BROKER_TRANSPORT_OPTIONS = {'visibility_timeout': 3600} # 1 hour.
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_ACCEPT_CONTENT=['json']
CELERY_ENABLE_UTC = True