|
|
@@ -1,365 +0,0 @@
|
|
1
|
|
-import os
|
|
2
|
|
-
|
|
3
|
|
-# Path helper
|
|
4
|
|
-location = lambda x: os.path.join(
|
|
5
|
|
- os.path.dirname(os.path.realpath(__file__)), x)
|
|
6
|
|
-
|
|
7
|
|
-USE_TZ = True
|
|
8
|
|
-
|
|
9
|
|
-DEBUG = True
|
|
10
|
|
-TEMPLATE_DEBUG = True
|
|
11
|
|
-SQL_DEBUG = True
|
|
12
|
|
-
|
|
13
|
|
-EMAIL_SUBJECT_PREFIX = '[Oscar US sandbox] '
|
|
14
|
|
-EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
|
15
|
|
-
|
|
16
|
|
-# Use a Sqlite database by default
|
|
17
|
|
-DATABASES = {
|
|
18
|
|
- 'default': {
|
|
19
|
|
- 'ENGINE': 'django.db.backends.sqlite3',
|
|
20
|
|
- 'NAME': location('db.sqlite'),
|
|
21
|
|
- 'USER': '',
|
|
22
|
|
- 'PASSWORD': '',
|
|
23
|
|
- 'HOST': '',
|
|
24
|
|
- 'PORT': '',
|
|
25
|
|
- 'ATOMIC_REQUESTS': True
|
|
26
|
|
- }
|
|
27
|
|
-}
|
|
28
|
|
-
|
|
29
|
|
-CACHES = {
|
|
30
|
|
- 'default': {
|
|
31
|
|
- 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
|
|
32
|
|
- }
|
|
33
|
|
-}
|
|
34
|
|
-
|
|
35
|
|
-
|
|
36
|
|
-# Local time zone for this installation. Choices can be found here:
|
|
37
|
|
-# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
|
38
|
|
-# although not all choices may be available on all operating systems.
|
|
39
|
|
-# On Unix systems, a value of None will cause Django to use the same
|
|
40
|
|
-# timezone as the operating system.
|
|
41
|
|
-# If running in a Windows environment this must be set to the same as your
|
|
42
|
|
-# system time zone.
|
|
43
|
|
-TIME_ZONE = 'Europe/London'
|
|
44
|
|
-
|
|
45
|
|
-# Language code for this installation. All choices can be found here:
|
|
46
|
|
-# http://www.i18nguy.com/unicode/language-identifiers.html
|
|
47
|
|
-LANGUAGE_CODE = 'en-gb'
|
|
48
|
|
-
|
|
49
|
|
-# Includes all languages that have >50% coverage in Transifex
|
|
50
|
|
-# Taken from Django's default setting for LANGUAGES
|
|
51
|
|
-gettext_noop = lambda s: s
|
|
52
|
|
-LANGUAGES = (
|
|
53
|
|
- ('en-us', gettext_noop('American English')),
|
|
54
|
|
-)
|
|
55
|
|
-
|
|
56
|
|
-SITE_ID = 1
|
|
57
|
|
-
|
|
58
|
|
-# If you set this to False, Django will make some optimizations so as not
|
|
59
|
|
-# to load the internationalization machinery.
|
|
60
|
|
-USE_I18N = True
|
|
61
|
|
-
|
|
62
|
|
-# If you set this to False, Django will not format dates, numbers and
|
|
63
|
|
-# calendars according to the current locale
|
|
64
|
|
-USE_L10N = True
|
|
65
|
|
-
|
|
66
|
|
-# Absolute path to the directory that holds media.
|
|
67
|
|
-# Example: "/home/media/media.lawrence.com/"
|
|
68
|
|
-MEDIA_ROOT = location("public/media")
|
|
69
|
|
-
|
|
70
|
|
-# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
|
71
|
|
-# trailing slash if there is a path component (optional in other cases).
|
|
72
|
|
-# Examples: "http://media.lawrence.com", "http://example.com/media/"
|
|
73
|
|
-MEDIA_URL = '/media/'
|
|
74
|
|
-
|
|
75
|
|
-# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
|
|
76
|
|
-# trailing slash.
|
|
77
|
|
-# Examples: "http://foo.com/media/", "/media/".
|
|
78
|
|
-#ADMIN_MEDIA_PREFIX = '/media/admin/'
|
|
79
|
|
-
|
|
80
|
|
-STATIC_URL = '/static/'
|
|
81
|
|
-STATIC_ROOT = location('public/static')
|
|
82
|
|
-STATICFILES_DIRS = (
|
|
83
|
|
- location('static/'),
|
|
84
|
|
-)
|
|
85
|
|
-STATICFILES_FINDERS = (
|
|
86
|
|
- 'django.contrib.staticfiles.finders.FileSystemFinder',
|
|
87
|
|
- 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
|
88
|
|
-)
|
|
89
|
|
-
|
|
90
|
|
-# Make this unique, and don't share it with anybody.
|
|
91
|
|
-SECRET_KEY = '$)a6n&o80u!6y5t-+jrd3)3!%vh&shg$wqpjpxc!ar&p#!)n1a'
|
|
92
|
|
-
|
|
93
|
|
-# List of callables that know how to import templates from various sources.
|
|
94
|
|
-TEMPLATE_LOADERS = (
|
|
95
|
|
- 'django.template.loaders.filesystem.Loader',
|
|
96
|
|
- 'django.template.loaders.app_directories.Loader',
|
|
97
|
|
- # needed by django-treebeard for admin (and potentially other libs)
|
|
98
|
|
- 'django.template.loaders.eggs.Loader',
|
|
99
|
|
-)
|
|
100
|
|
-
|
|
101
|
|
-TEMPLATE_CONTEXT_PROCESSORS = (
|
|
102
|
|
- "django.contrib.auth.context_processors.auth",
|
|
103
|
|
- "django.core.context_processors.request",
|
|
104
|
|
- "django.core.context_processors.debug",
|
|
105
|
|
- "django.core.context_processors.i18n",
|
|
106
|
|
- "django.core.context_processors.media",
|
|
107
|
|
- "django.core.context_processors.static",
|
|
108
|
|
- "django.contrib.messages.context_processors.messages",
|
|
109
|
|
- # Oscar specific
|
|
110
|
|
- 'oscar.apps.search.context_processors.search_form',
|
|
111
|
|
- 'oscar.apps.promotions.context_processors.promotions',
|
|
112
|
|
- 'oscar.apps.checkout.context_processors.checkout',
|
|
113
|
|
- 'oscar.core.context_processors.metadata',
|
|
114
|
|
- 'oscar.apps.customer.notifications.context_processors.notifications',
|
|
115
|
|
-)
|
|
116
|
|
-
|
|
117
|
|
-MIDDLEWARE_CLASSES = (
|
|
118
|
|
- 'debug_toolbar.middleware.DebugToolbarMiddleware',
|
|
119
|
|
- 'django.contrib.sessions.middleware.SessionMiddleware',
|
|
120
|
|
- 'django.middleware.csrf.CsrfViewMiddleware',
|
|
121
|
|
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
122
|
|
- 'django.contrib.messages.middleware.MessageMiddleware',
|
|
123
|
|
- 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
|
|
124
|
|
- # Allow languages to be selected
|
|
125
|
|
- 'django.middleware.locale.LocaleMiddleware',
|
|
126
|
|
- 'django.middleware.common.CommonMiddleware',
|
|
127
|
|
- # Ensure a valid basket is added to the request instance for every request
|
|
128
|
|
- 'oscar.apps.basket.middleware.BasketMiddleware',
|
|
129
|
|
- # Enable the ProfileMiddleware, then add ?cprofile to any
|
|
130
|
|
- # URL path to print out profile details
|
|
131
|
|
- # 'oscar.profiling.middleware.ProfileMiddleware',
|
|
132
|
|
-)
|
|
133
|
|
-
|
|
134
|
|
-ROOT_URLCONF = 'urls'
|
|
135
|
|
-
|
|
136
|
|
-# Add another path to Oscar's templates. This allows templates to be
|
|
137
|
|
-# customised easily.
|
|
138
|
|
-from oscar import OSCAR_MAIN_TEMPLATE_DIR
|
|
139
|
|
-TEMPLATE_DIRS = (
|
|
140
|
|
- location('templates'),
|
|
141
|
|
- OSCAR_MAIN_TEMPLATE_DIR,
|
|
142
|
|
-)
|
|
143
|
|
-
|
|
144
|
|
-# A sample logging configuration. The only tangible logging
|
|
145
|
|
-# performed by this configuration is to send an email to
|
|
146
|
|
-# the site admins on every HTTP 500 error.
|
|
147
|
|
-# See http://docs.djangoproject.com/en/dev/topics/logging for
|
|
148
|
|
-# more details on how to customize your logging configuration.
|
|
149
|
|
-LOGGING = {
|
|
150
|
|
- 'version': 1,
|
|
151
|
|
- 'disable_existing_loggers': True,
|
|
152
|
|
- 'formatters': {
|
|
153
|
|
- 'verbose': {
|
|
154
|
|
- 'format': '%(levelname)s %(asctime)s %(module)s %(message)s',
|
|
155
|
|
- },
|
|
156
|
|
- 'simple': {
|
|
157
|
|
- 'format': '[%(asctime)s] %(message)s'
|
|
158
|
|
- },
|
|
159
|
|
- },
|
|
160
|
|
- 'filters': {
|
|
161
|
|
- 'require_debug_false': {
|
|
162
|
|
- '()': 'django.utils.log.RequireDebugFalse'
|
|
163
|
|
- }
|
|
164
|
|
- },
|
|
165
|
|
- 'handlers': {
|
|
166
|
|
- 'null': {
|
|
167
|
|
- 'level': 'DEBUG',
|
|
168
|
|
- 'class': 'logging.NullHandler',
|
|
169
|
|
- },
|
|
170
|
|
- 'console': {
|
|
171
|
|
- 'level': 'DEBUG',
|
|
172
|
|
- 'class': 'logging.StreamHandler',
|
|
173
|
|
- 'formatter': 'verbose'
|
|
174
|
|
- },
|
|
175
|
|
- 'checkout_file': {
|
|
176
|
|
- 'level': 'INFO',
|
|
177
|
|
- 'class': 'oscar.core.logging.handlers.EnvFileHandler',
|
|
178
|
|
- 'filename': 'checkout.log',
|
|
179
|
|
- 'formatter': 'verbose'
|
|
180
|
|
- },
|
|
181
|
|
- 'gateway_file': {
|
|
182
|
|
- 'level': 'INFO',
|
|
183
|
|
- 'class': 'oscar.core.logging.handlers.EnvFileHandler',
|
|
184
|
|
- 'filename': 'gateway.log',
|
|
185
|
|
- 'formatter': 'simple'
|
|
186
|
|
- },
|
|
187
|
|
- 'error_file': {
|
|
188
|
|
- 'level': 'INFO',
|
|
189
|
|
- 'class': 'oscar.core.logging.handlers.EnvFileHandler',
|
|
190
|
|
- 'filename': 'errors.log',
|
|
191
|
|
- 'formatter': 'verbose'
|
|
192
|
|
- },
|
|
193
|
|
- 'sorl_file': {
|
|
194
|
|
- 'level': 'INFO',
|
|
195
|
|
- 'class': 'oscar.core.logging.handlers.EnvFileHandler',
|
|
196
|
|
- 'filename': 'sorl.log',
|
|
197
|
|
- 'formatter': 'verbose'
|
|
198
|
|
- },
|
|
199
|
|
- 'mail_admins': {
|
|
200
|
|
- 'level': 'ERROR',
|
|
201
|
|
- 'class': 'django.utils.log.AdminEmailHandler',
|
|
202
|
|
- 'filters': ['require_debug_false'],
|
|
203
|
|
- },
|
|
204
|
|
- },
|
|
205
|
|
- 'loggers': {
|
|
206
|
|
- # Django loggers
|
|
207
|
|
- 'django': {
|
|
208
|
|
- 'handlers': ['null'],
|
|
209
|
|
- 'propagate': True,
|
|
210
|
|
- 'level': 'INFO',
|
|
211
|
|
- },
|
|
212
|
|
- 'django.request': {
|
|
213
|
|
- 'handlers': ['mail_admins', 'error_file'],
|
|
214
|
|
- 'level': 'ERROR',
|
|
215
|
|
- 'propagate': False,
|
|
216
|
|
- },
|
|
217
|
|
- 'django.db.backends': {
|
|
218
|
|
- 'handlers': ['null'],
|
|
219
|
|
- 'propagate': False,
|
|
220
|
|
- 'level': 'DEBUG',
|
|
221
|
|
- },
|
|
222
|
|
- # Oscar core loggers
|
|
223
|
|
- 'oscar.checkout': {
|
|
224
|
|
- 'handlers': ['console', 'checkout_file'],
|
|
225
|
|
- 'propagate': False,
|
|
226
|
|
- 'level': 'INFO',
|
|
227
|
|
- },
|
|
228
|
|
- 'oscar.catalogue.import': {
|
|
229
|
|
- 'handlers': ['console'],
|
|
230
|
|
- 'propagate': False,
|
|
231
|
|
- 'level': 'INFO',
|
|
232
|
|
- },
|
|
233
|
|
- 'oscar.alerts': {
|
|
234
|
|
- 'handlers': ['null'],
|
|
235
|
|
- 'propagate': False,
|
|
236
|
|
- 'level': 'INFO',
|
|
237
|
|
- },
|
|
238
|
|
- # Sandbox logging
|
|
239
|
|
- 'gateway': {
|
|
240
|
|
- 'handlers': ['gateway_file'],
|
|
241
|
|
- 'propagate': True,
|
|
242
|
|
- 'level': 'INFO',
|
|
243
|
|
- },
|
|
244
|
|
- # Third party
|
|
245
|
|
- 'sorl.thumbnail': {
|
|
246
|
|
- 'handlers': ['sorl_file'],
|
|
247
|
|
- 'propagate': True,
|
|
248
|
|
- 'level': 'INFO',
|
|
249
|
|
- },
|
|
250
|
|
- # Suppress output of this debug toolbar panel
|
|
251
|
|
- 'template_timings_panel': {
|
|
252
|
|
- 'handlers': ['null'],
|
|
253
|
|
- 'level': 'DEBUG',
|
|
254
|
|
- 'propagate': False,
|
|
255
|
|
- }
|
|
256
|
|
- }
|
|
257
|
|
-}
|
|
258
|
|
-
|
|
259
|
|
-
|
|
260
|
|
-INSTALLED_APPS = [
|
|
261
|
|
- 'django.contrib.auth',
|
|
262
|
|
- 'django.contrib.contenttypes',
|
|
263
|
|
- 'django.contrib.sessions',
|
|
264
|
|
- 'django.contrib.sites',
|
|
265
|
|
- 'django.contrib.messages',
|
|
266
|
|
- 'django.contrib.admin',
|
|
267
|
|
- 'django.contrib.flatpages',
|
|
268
|
|
- 'django.contrib.staticfiles',
|
|
269
|
|
- 'django.contrib.sitemaps',
|
|
270
|
|
- 'django_extensions',
|
|
271
|
|
- # Debug toolbar + extensions
|
|
272
|
|
- 'debug_toolbar',
|
|
273
|
|
- 'template_timings_panel',
|
|
274
|
|
- 'widget_tweaks',
|
|
275
|
|
-]
|
|
276
|
|
-from oscar import get_core_apps
|
|
277
|
|
-INSTALLED_APPS = INSTALLED_APPS + get_core_apps(
|
|
278
|
|
- ['apps.partner', 'apps.checkout', 'apps.shipping'])
|
|
279
|
|
-
|
|
280
|
|
-# Add Oscar's custom auth backend so users can sign in using their email
|
|
281
|
|
-# address.
|
|
282
|
|
-AUTHENTICATION_BACKENDS = (
|
|
283
|
|
- 'oscar.apps.customer.auth_backends.EmailBackend',
|
|
284
|
|
- 'django.contrib.auth.backends.ModelBackend',
|
|
285
|
|
-)
|
|
286
|
|
-
|
|
287
|
|
-LOGIN_REDIRECT_URL = '/'
|
|
288
|
|
-APPEND_SLASH = True
|
|
289
|
|
-
|
|
290
|
|
-# Haystack settings
|
|
291
|
|
-HAYSTACK_CONNECTIONS = {
|
|
292
|
|
- 'default': {
|
|
293
|
|
- 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
|
|
294
|
|
- 'PATH': location('whoosh_index'),
|
|
295
|
|
- },
|
|
296
|
|
-}
|
|
297
|
|
-
|
|
298
|
|
-# =============
|
|
299
|
|
-# Debug Toolbar
|
|
300
|
|
-# =============
|
|
301
|
|
-
|
|
302
|
|
-# Implicit setup can often lead to problems with circular imports, so we
|
|
303
|
|
-# explicitly wire up the toolbar
|
|
304
|
|
-DEBUG_TOOLBAR_PATCH_SETTINGS = False
|
|
305
|
|
-DEBUG_TOOLBAR_PANELS = [
|
|
306
|
|
- 'debug_toolbar.panels.versions.VersionsPanel',
|
|
307
|
|
- 'debug_toolbar.panels.timer.TimerPanel',
|
|
308
|
|
- 'debug_toolbar.panels.settings.SettingsPanel',
|
|
309
|
|
- 'debug_toolbar.panels.headers.HeadersPanel',
|
|
310
|
|
- 'debug_toolbar.panels.request.RequestPanel',
|
|
311
|
|
- 'debug_toolbar.panels.sql.SQLPanel',
|
|
312
|
|
- 'debug_toolbar.panels.staticfiles.StaticFilesPanel',
|
|
313
|
|
- 'debug_toolbar.panels.templates.TemplatesPanel',
|
|
314
|
|
- 'template_timings_panel.panels.TemplateTimings.TemplateTimings',
|
|
315
|
|
- 'debug_toolbar.panels.cache.CachePanel',
|
|
316
|
|
- 'debug_toolbar.panels.signals.SignalsPanel',
|
|
317
|
|
- 'debug_toolbar.panels.logging.LoggingPanel',
|
|
318
|
|
- 'debug_toolbar.panels.redirects.RedirectsPanel',
|
|
319
|
|
-]
|
|
320
|
|
-INTERNAL_IPS = ['127.0.0.1', '::1']
|
|
321
|
|
-
|
|
322
|
|
-# ==============
|
|
323
|
|
-# Oscar settings
|
|
324
|
|
-# ==============
|
|
325
|
|
-
|
|
326
|
|
-from oscar.defaults import * # noqa
|
|
327
|
|
-
|
|
328
|
|
-# Meta
|
|
329
|
|
-# ====
|
|
330
|
|
-
|
|
331
|
|
-OSCAR_SHOP_TAGLINE = 'US Sandbox'
|
|
332
|
|
-OSCAR_DEFAULT_CURRENCY = 'USD'
|
|
333
|
|
-OSCAR_ALLOW_ANON_CHECKOUT = True
|
|
334
|
|
-
|
|
335
|
|
-# LESS/CSS
|
|
336
|
|
-# ========
|
|
337
|
|
-
|
|
338
|
|
-# We default to using CSS files, rather than the LESS files that generate them.
|
|
339
|
|
-# If you want to develop Oscar's CSS, then set USE_LESS=True to enable the
|
|
340
|
|
-# on-the-fly less processor.
|
|
341
|
|
-USE_LESS = False
|
|
342
|
|
-
|
|
343
|
|
-# Logging
|
|
344
|
|
-# =======
|
|
345
|
|
-
|
|
346
|
|
-LOG_ROOT = location('logs')
|
|
347
|
|
-# Ensure log root exists
|
|
348
|
|
-if not os.path.exists(LOG_ROOT):
|
|
349
|
|
- os.mkdir(LOG_ROOT)
|
|
350
|
|
-
|
|
351
|
|
-# Sorl
|
|
352
|
|
-# ====
|
|
353
|
|
-
|
|
354
|
|
-THUMBNAIL_DEBUG = True
|
|
355
|
|
-THUMBNAIL_KEY_PREFIX = 'oscar-us-sandbox'
|
|
356
|
|
-
|
|
357
|
|
-SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'
|
|
358
|
|
-
|
|
359
|
|
-TEST_RUNNER = 'django.test.runner.DiscoverRunner'
|
|
360
|
|
-
|
|
361
|
|
-# Try and import local settings which can be used to override any of the above.
|
|
362
|
|
-try:
|
|
363
|
|
- from settings_local import * # noqa
|
|
364
|
|
-except ImportError:
|
|
365
|
|
- pass
|