-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.py
234 lines (193 loc) · 5.81 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# -*- coding: utf-8 -*-
# https://docs.djangoproject.com/en/dev/ref/settings/
import os, os.path, posixpath
ADMINS = [
('James Pic', '[email protected]'),
('James Pic', '[email protected]'),
('David Bellaiche', '[email protected]'),
]
MANAGERS = ADMINS
LANGUAGE_CODE = 'fr'
TIME_ZONE = 'Europe/Paris'
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
MEDIA_ROOT=os.path.join(PROJECT_ROOT, 'site_media', 'media')
MEDIA_URL='/site_media/media/'
STATIC_ROOT=os.path.join(PROJECT_ROOT, 'site_media', 'static')
STATIC_URL='/site_media/static/'
COMPRESS_ROOT=os.path.join(PROJECT_ROOT, 'site_media', 'static')
TEMPLATE_CONTEXT_PROCESSORS = [
'django.core.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.request',
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.static',
#'staticfiles.context_processors.static_url',
'pinax.core.context_processors.pinax_settings',
'bet.context_processors.incomplete_ticket',
'scoobet.context_processors.inbox_count',
'gsm.context_processors.available_timezones',
'gsm.context_processors.five_popular_sessions',
'context_processors.save_user_locale',
]
#gnochi-cms
DEFAULT_TEMPLATE = 'default.html'
MIDDLEWARE_CLASSES = [
'localeurl.middleware.LocaleURLMiddleware',
#'johnny.middleware.LocalStoreClearMiddleware',
#'johnny.middleware.QueryCacheMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.transaction.TransactionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
#'beta.middleware.LoginMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
#'debug_toolbar.middleware.DebugToolbarMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
'pagination.middleware.PaginationMiddleware',
'gsm.middleware.TimezoneMiddleware',
'middleware.ExceptionMiddleware',
]
APPEND_SLASH = True
EXCEPTION_MIDDLEWARE_HANDLES = [
'HtmlInsteadOfXml',
'ServerOverloaded',
'MessagingUnauthorizedUser',
'BetTooLateException',
]
INSTALLED_APPS = [
'localeurl',
'beta',
'compressor',
# Django
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.humanize',
'django.contrib.comments',
'django.contrib.markup',
'django.contrib.flatpages',
'django.contrib.staticfiles',
'pinax.templatetags',
'emailconfirmation',
'pinax.apps.account',
# external
#'staticfiles',
'debug_toolbar',
#'mailer',
'uni_form',
'ajax_validation',
'timezones',
'emailconfirmation',
'django_extensions',
'django_filters',
'pagination',
'ajax_select',
'sentry.client',
'avatar',
'actstream',
'endless_pagination',
'autofixture',
'nashvegas',
'django_messages',
'taggit',
'subscription',
'subscription.examples.yourlabs',
#'devserver',
'rosetta',
# Pinax
# to open source
'clan',
'article',
'yourlabs.smoke',
'yourlabs.runner',
# project
'gsm',
'bookmaker',
'bet',
# this must be at the end because it monkey patches the admin
'scoobet',
'haystack',
'modeltranslation',
]
ROSETTA_MESSAGES_PER_PAGE=100
ROSETTA_ENABLE_TRANSLATION_SUGGESTIONS=True
BING_APP_ID='3AF372499E210397A857F17733E469F3323B164C'
SUBSCRIPTION_NOTIFICATION_QUEUES = [
'chat',
'friends',
]
COMPRESS_ENABLED=True
STATICFILES_DIRS = [
os.path.join(PROJECT_ROOT, 'static'),
]
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
'compressor.finders.CompressorFinder',
)
ACCOUNT_EMAIL_VERIFICATION = True
SMOKE_TEST_USERNAME='gsm_test'
SMOKE_TEST_PASSWORD='()&*EUTOSHue()&*UESTNHlrch'
GSM_LOCKFILE_POLLRATE = .1
GSM_LOCKFILE_MAXPOLLS = 30
GSM_USERNAME = 'betspire'
GSM_PASSWORD = 'lixzw2c'
GSM_LANGUAGE = 'fr'
GSM_URL = 'http://%s:%[email protected]' % (
GSM_USERNAME,
GSM_PASSWORD,
)
# for upstream server overload test
#GSM_URL = 'http://localhost:8000'
# we have our own locale switcher
LOCALEURL_USE_ACCEPT_LANGUAGE = False
import re
LOCALE_INDEPENDENT_PATHS = [
re.compile('/notifications/json/'),
re.compile('/notifications/push/'),
]
gettext = lambda x: x
LANGUAGES = (
('en', gettext('English')),
('fr', gettext('French')),
)
USE_PINAX = True
AJAX_LOOKUP_CHANNELS = {
'session': ('gsm.lookups', 'SessionLookup'),
'user': {'model': 'auth.User', 'search_field':'username'},
}
USE_COMMENTS_AS_WALL = True
HAYSTACK_ENABLE_REGISTRATION = False
SUBSCRIPTION_BACKENDS = {
'storage': 'subscription.examples.yourlabs.backends.RedisBackend',
}
CACHES = {
'default' : dict(
BACKEND = 'johnny.backends.memcached.MemcachedCache',
LOCATION = ['127.0.0.1:11211'],
JOHNNY_CACHE = True,
)
}
JOHNNY_MIDDLEWARE_KEY_PREFIX='bet'
from yourlabs.setup import Setup
setup = Setup(globals())
setup.debug(False)
setup.full()
if setup.ready:
setup.add_logger('redis')
setup.add_logger('gsm')
setup.add_logger('gsm_bugs')
setup.add_logger('gsm_delete')
GSM_CACHE = os.path.join(VAR_ROOT, 'cache', 'gsm')
if not os.path.exists(GSM_CACHE):
os.makedirs(GSM_CACHE)
# local_settings.py can be used to override environment-specific settings
# like database and email that differ between development and production.
from local_settings import *