Kaynağa Gözat

auto commit

master
jfinn 8 ay önce
ebeveyn
işleme
0153af147c
1 değiştirilmiş dosya ile 296 ekleme ve 198 silme
  1. 296
    198
      edan_v1/edan_v1/settings.py

+ 296
- 198
edan_v1/edan_v1/settings.py Dosyayı Görüntüle

@@ -1,145 +1,133 @@
1
-"""
2
-Django settings for edan_v1 project.
3
-
4
-Generated by 'django-admin startproject' using Django 4.2.15.
5
-
6
-For more information on this file, see
7
-https://docs.djangoproject.com/en/4.2/topics/settings/
1
+import os
2
+import environ
3
+import oscar
8 4
 
9
-For the full list of settings and their values, see
10
-https://docs.djangoproject.com/en/4.2/ref/settings/
11
-"""
5
+env = environ.Env()
12 6
 
13
-# print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
14 7
 
15
-from pathlib import Path
16
-import os
17
-
18
-from oscar.defaults import *
8
+# WSGI_APPLICATION = "sandbox.wsgi.application"
9
+# ASGI_APPLICATION = "sandbox.asgi.application"
10
+# Path helper
19 11
 location = lambda x: os.path.join(
20 12
     os.path.dirname(os.path.realpath(__file__)), x)
21 13
 
22
-# Build paths inside the project like this: BASE_DIR / 'subdir'.
23
-BASE_DIR = Path(__file__).resolve().parent.parent
24
-
25
-
26
-# Quick-start development settings - unsuitable for production
27
-# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
28
-
29
-# SECURITY WARNING: keep the secret key used in production secret!
30
-SECRET_KEY = "django-insecure-u-z7gqgjpc()eos-$!35o$k$=a6fj9a34-9q%-eo2$*kcx3*ik"
31
-
32
-# SECURITY WARNING: don't run with debug turned on in production!
14
+DEBUG = env.bool('DEBUG', default=True)
33 15
 DEBUG = True
16
+ALLOWED_HOSTS = env.list('ALLOWED_HOSTS', default=['localhost', '127.0.0.1'])
34 17
 
35
-ALLOWED_HOSTS = ["*"]
18
+ALLOWED_HOSTS = [*ALLOWED_HOSTS,"dev.edanflor.com"]
36 19
 CSRF_TRUSTED_ORIGINS =["https://*.edanflor.com"]
20
+EMAIL_SUBJECT_PREFIX = '[Oscar sandbox] '
21
+EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
37 22
 
38
-# CORS_ORIGIN_WHITELIST
39
-
40
-# Application definition
41
-
42
-INSTALLED_APPS = [
43
-    
44
-    # 'daphne',
45
-    'channels',
46
-    "hrld",
47
-
48
-    "django.contrib.admin",
49
-    "django.contrib.auth",
50
-    "django.contrib.contenttypes",
51
-    "django.contrib.sessions",
52
-    "django.contrib.messages",
53
-    "django.contrib.staticfiles",
54
-
55
-    #added V
56
-
57
-
58
-    'django.contrib.sites',
59
-    'django.contrib.flatpages',
60
-
61
-    'oscar.config.Shop',
62
-    'oscar.apps.analytics.apps.AnalyticsConfig',
63
-    'oscar.apps.checkout.apps.CheckoutConfig',
64
-    'oscar.apps.address.apps.AddressConfig',
65
-    'oscar.apps.shipping.apps.ShippingConfig',
66
-    'oscar.apps.catalogue.apps.CatalogueConfig',
67
-    'oscar.apps.catalogue.reviews.apps.CatalogueReviewsConfig',
68
-    'oscar.apps.communication.apps.CommunicationConfig',
69
-    'oscar.apps.partner.apps.PartnerConfig',
70
-    'oscar.apps.basket.apps.BasketConfig',
71
-    'oscar.apps.payment.apps.PaymentConfig',
72
-    'oscar.apps.offer.apps.OfferConfig',
73
-    'oscar.apps.order.apps.OrderConfig',
74
-    'oscar.apps.customer.apps.CustomerConfig',
75
-    'oscar.apps.search.apps.SearchConfig',
76
-    'oscar.apps.voucher.apps.VoucherConfig',
77
-    'oscar.apps.wishlists.apps.WishlistsConfig',
78
-    'oscar.apps.dashboard.apps.DashboardConfig',
79
-    'oscar.apps.dashboard.reports.apps.ReportsDashboardConfig',
80
-    'oscar.apps.dashboard.users.apps.UsersDashboardConfig',
81
-    'oscar.apps.dashboard.orders.apps.OrdersDashboardConfig',
82
-    'oscar.apps.dashboard.catalogue.apps.CatalogueDashboardConfig',
83
-    'oscar.apps.dashboard.offers.apps.OffersDashboardConfig',
84
-    'oscar.apps.dashboard.partners.apps.PartnersDashboardConfig',
85
-    'oscar.apps.dashboard.pages.apps.PagesDashboardConfig',
86
-    'oscar.apps.dashboard.ranges.apps.RangesDashboardConfig',
87
-    'oscar.apps.dashboard.reviews.apps.ReviewsDashboardConfig',
88
-    'oscar.apps.dashboard.vouchers.apps.VouchersDashboardConfig',
89
-    'oscar.apps.dashboard.communications.apps.CommunicationsDashboardConfig',
90
-    'oscar.apps.dashboard.shipping.apps.ShippingDashboardConfig',
91
-
92
-    # 3rd-party apps that oscar depends on
93
-    'widget_tweaks',
94
-    'haystack',
95
-    'treebeard',
96
-    'sorl.thumbnail',   # Default thumbnail backend, can be replaced
97
-    'easy_thumbnails',
23
+# Use a Sqlite database by default
24
+DATABASES = {
25
+    'default': {
26
+        'ENGINE': os.environ.get('DATABASE_ENGINE', 'django.db.backends.sqlite3'),
27
+        'NAME': os.environ.get('DATABASE_NAME', location('db.sqlite')),
28
+        'USER': os.environ.get('DATABASE_USER', None),
29
+        'PASSWORD': os.environ.get('DATABASE_PASSWORD', None),
30
+        'HOST': os.environ.get('DATABASE_HOST', None),
31
+        'PORT': os.environ.get('DATABASE_PORT', None),
32
+        'ATOMIC_REQUESTS': True
33
+    }
34
+}
98 35
 
99
-    'django_tables2',
36
+CACHES = {
37
+    'default': env.cache(default='locmemcache://'),
38
+}
100 39
 
101 40
 
102
-    'django.contrib.sitemaps',
41
+# Local time zone for this installation. Choices can be found here:
42
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
43
+# although not all choices may be available on all operating systems.
44
+# On Unix systems, a value of None will cause Django to use the same
45
+# timezone as the operating system.
46
+USE_TZ = True
47
+TIME_ZONE = 'Europe/London'
48
+
49
+TEST_RUNNER = 'django.test.runner.DiscoverRunner'
50
+
51
+# Language code for this installation. All choices can be found here:
52
+# http://www.i18nguy.com/unicode/language-identifiers.html
53
+LANGUAGE_CODE = 'en-gb'
54
+
55
+# Includes all languages that have >50% coverage in Transifex
56
+# Taken from Django's default setting for LANGUAGES
57
+gettext_noop = lambda s: s
58
+LANGUAGES = (
59
+    ('ar', gettext_noop('Arabic')),
60
+    ('ca', gettext_noop('Catalan')),
61
+    ('cs', gettext_noop('Czech')),
62
+    ('da', gettext_noop('Danish')),
63
+    ('de', gettext_noop('German')),
64
+    ('en-gb', gettext_noop('British English')),
65
+    ('el', gettext_noop('Greek')),
66
+    ('es', gettext_noop('Spanish')),
67
+    ('fi', gettext_noop('Finnish')),
68
+    ('fr', gettext_noop('French')),
69
+    ('it', gettext_noop('Italian')),
70
+    ('ko', gettext_noop('Korean')),
71
+    ('nl', gettext_noop('Dutch')),
72
+    ('pl', gettext_noop('Polish')),
73
+    ('pt', gettext_noop('Portuguese')),
74
+    ('pt-br', gettext_noop('Brazilian Portuguese')),
75
+    ('ro', gettext_noop('Romanian')),
76
+    ('ru', gettext_noop('Russian')),
77
+    ('sk', gettext_noop('Slovak')),
78
+    ('uk', gettext_noop('Ukrainian')),
79
+    ('zh-cn', gettext_noop('Simplified Chinese')),
80
+)
103 81
 
104
-    # 3rd-party apps that the sandbox depends on
105
-    'django_extensions',
106
-    'debug_toolbar',
82
+SITE_ID = 1
107 83
 
84
+# If you set this to False, Django will make some optimizations so as not
85
+# to load the internationalization machinery.
86
+USE_I18N = True
108 87
 
109
-]
110
-SITE_ID = 1 #added
88
+# If you set this to False, Django will not format dates, numbers and
89
+# calendars according to the current locale
90
+USE_L10N = True
111 91
 
112
-MIDDLEWARE = [
92
+# Absolute path to the directory that holds media.
93
+# Example: "/home/media/media.lawrence.com/"
94
+MEDIA_ROOT = location("public/media")
113 95
 
114
-    'debug_toolbar.middleware.DebugToolbarMiddleware',
96
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
97
+# trailing slash if there is a path component (optional in other cases).
98
+# Examples: "http://media.lawrence.com", "http://example.com/media/"
99
+MEDIA_URL = '/media/'
115 100
 
116
-    "django.middleware.security.SecurityMiddleware",
117
-    "django.contrib.sessions.middleware.SessionMiddleware",
118
-    "django.middleware.common.CommonMiddleware",
119
-    "django.middleware.csrf.CsrfViewMiddleware",
120
-    "django.contrib.auth.middleware.AuthenticationMiddleware",
121
-    "django.contrib.messages.middleware.MessageMiddleware",
122
-    "django.middleware.clickjacking.XFrameOptionsMiddleware",
101
+STATIC_URL = '/static/'
102
+STATIC_ROOT = location('public/static')
103
+STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
104
+STATICFILES_DIRS = (
105
+    location('static/'),
106
+)
107
+STATICFILES_FINDERS = (
108
+    'django.contrib.staticfiles.finders.FileSystemFinder',
109
+    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
110
+)
123 111
 
124
-    'oscar.apps.basket.middleware.BasketMiddleware',
125
-    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
126
-]
112
+# Default primary key field type
113
+# https://docs.djangoproject.com/en/dev/ref/settings/#default-auto-field
114
+DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
127 115
 
128
-ROOT_URLCONF = "edan_v1.urls"
116
+# Make this unique, and don't share it with anybody.
117
+SECRET_KEY = env.str('SECRET_KEY', default='UajFCuyjDKmWHe29neauXzHi9eZoRXr6RMbT5JyAdPiACBP6Cra2')
129 118
 
130 119
 TEMPLATES = [
131 120
     {
132
-        "BACKEND": "django.template.backends.django.DjangoTemplates",
133
-        "DIRS": [],
134
-        # "APP_DIRS": True,
135
-        "OPTIONS": {
136
-
121
+        'BACKEND': 'django.template.backends.django.DjangoTemplates',
122
+        'DIRS': [
123
+            location('templates'),
124
+        ],
125
+        'OPTIONS': {
137 126
             'loaders': [
138 127
                 'django.template.loaders.filesystem.Loader',
139 128
                 'django.template.loaders.app_directories.Loader',
140 129
             ],
141
-
142
-            "context_processors": [
130
+            'context_processors': [
143 131
                 'django.contrib.auth.context_processors.auth',
144 132
                 'django.template.context_processors.request',
145 133
                 'django.template.context_processors.debug',
@@ -148,90 +136,47 @@ TEMPLATES = [
148 136
                 'django.template.context_processors.static',
149 137
                 'django.contrib.messages.context_processors.messages',
150 138
 
151
-                # "django.template.context_processors.debug",
152
-                # "django.template.context_processors.request",
153
-                # "django.contrib.auth.context_processors.auth",
154
-                # "django.contrib.messages.context_processors.messages",
155
-
139
+                # Oscar specific
156 140
                 'oscar.apps.search.context_processors.search_form',
157
-                'oscar.apps.checkout.context_processors.checkout',
158 141
                 'oscar.apps.communication.notifications.context_processors.notifications',
142
+                'oscar.apps.checkout.context_processors.checkout',
159 143
                 'oscar.core.context_processors.metadata',
160
-
161
-
162 144
             ],
163 145
             'debug': DEBUG,
164
-        },
165
-    },
166
-]
167
-
168
-WSGI_APPLICATION = "edan_v1.wsgi.application"
169
-ASGI_APPLICATION = "edan_v1.asgi.application"
170
-
171
-
172
-# Database
173
-# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
174
-
175
-DATABASES = {
176
-    "default": {
177
-        "ENGINE": "django.db.backends.sqlite3",
178
-        "NAME": BASE_DIR / "db.sqlite3",
179
-
180
-
181
-        'USER': '',
182
-        'PASSWORD': '',
183
-        'HOST': '',
184
-        'PORT': '',
185
-        'ATOMIC_REQUESTS': True,
186
-
146
+        }
187 147
     }
188
-}
189
-
190
-AUTHENTICATION_BACKENDS = (
191
-    'oscar.apps.customer.auth_backends.EmailBackend',
192
-    'django.contrib.auth.backends.ModelBackend',
193
-)
194
-
195
-
196
-HAYSTACK_CONNECTIONS = {
197
-    'default': {
198
-        'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
199
-    },
200
-}
201
-HAYSTACK_CONNECTIONS_z = {
202
-    'default': {
203
-        'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
204
-        'URL': 'http://127.0.0.1:8983/solr',
205
-        'INCLUDE_SPELLING': True,
206
-    },
207
-}
208
-
209
-
210
-# Password validation
211
-# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
212
-
213
-AUTH_PASSWORD_VALIDATORS = [
214
-    {
215
-        "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
216
-    },
217
-    {
218
-        "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
219
-    },
220
-    {
221
-        "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
222
-    },
223
-    {
224
-        "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
225
-    },
226 148
 ]
227 149
 
150
+MIDDLEWARE = [
151
+    'debug_toolbar.middleware.DebugToolbarMiddleware',
228 152
 
153
+    'django.middleware.security.SecurityMiddleware',
154
+    'whitenoise.middleware.WhiteNoiseMiddleware',
229 155
 
156
+    'django.contrib.sessions.middleware.SessionMiddleware',
157
+    'django.middleware.csrf.CsrfViewMiddleware',
158
+    'django.middleware.clickjacking.XFrameOptionsMiddleware',
159
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
160
+    'django.contrib.messages.middleware.MessageMiddleware',
161
+    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
230 162
 
163
+    # Allow languages to be selected
164
+    'django.middleware.locale.LocaleMiddleware',
165
+    'django.middleware.http.ConditionalGetMiddleware',
166
+    'django.middleware.common.CommonMiddleware',
231 167
 
168
+    # Ensure a valid basket is added to the request instance for every request
169
+    'oscar.apps.basket.middleware.BasketMiddleware',
170
+]
232 171
 
172
+ROOT_URLCONF = 'urls'
233 173
 
234 174
 
175
+# A sample logging configuration. The only tangible logging
176
+# performed by this configuration is to send an email to
177
+# the site admins on every HTTP 500 error.
178
+# See http://docs.djangoproject.com/en/dev/topics/logging for
179
+# more details on how to customize your logging configuration.
235 180
 LOGGING = {
236 181
     'version': 1,
237 182
     'disable_existing_loggers': True,
@@ -309,37 +254,190 @@ LOGGING = {
309 254
 }
310 255
 
311 256
 
257
+INSTALLED_APPS = [
258
+    'django.contrib.admin',
259
+    'django.contrib.auth',
260
+    'django.contrib.contenttypes',
261
+    'django.contrib.sessions',
262
+    'django.contrib.messages',
263
+    'django.contrib.staticfiles',
264
+    'django.contrib.sites',
265
+    'django.contrib.flatpages',
312 266
 
267
+    'oscar.config.Shop',
268
+    'oscar.apps.analytics.apps.AnalyticsConfig',
269
+    'oscar.apps.checkout.apps.CheckoutConfig',
270
+    'oscar.apps.address.apps.AddressConfig',
271
+    'oscar.apps.shipping.apps.ShippingConfig',
272
+    'oscar.apps.catalogue.apps.CatalogueConfig',
273
+    'oscar.apps.catalogue.reviews.apps.CatalogueReviewsConfig',
274
+    'oscar.apps.communication.apps.CommunicationConfig',
275
+    'oscar.apps.partner.apps.PartnerConfig',
276
+    'oscar.apps.basket.apps.BasketConfig',
277
+    'oscar.apps.payment.apps.PaymentConfig',
278
+    'oscar.apps.offer.apps.OfferConfig',
279
+    'oscar.apps.order.apps.OrderConfig',
280
+    'oscar.apps.customer.apps.CustomerConfig',
281
+    'oscar.apps.search.apps.SearchConfig',
282
+    'oscar.apps.voucher.apps.VoucherConfig',
283
+    'oscar.apps.wishlists.apps.WishlistsConfig',
284
+    'oscar.apps.dashboard.apps.DashboardConfig',
285
+    'oscar.apps.dashboard.reports.apps.ReportsDashboardConfig',
286
+    'oscar.apps.dashboard.users.apps.UsersDashboardConfig',
287
+    'oscar.apps.dashboard.orders.apps.OrdersDashboardConfig',
288
+    'oscar.apps.dashboard.catalogue.apps.CatalogueDashboardConfig',
289
+    'oscar.apps.dashboard.offers.apps.OffersDashboardConfig',
290
+    'oscar.apps.dashboard.partners.apps.PartnersDashboardConfig',
291
+    'oscar.apps.dashboard.pages.apps.PagesDashboardConfig',
292
+    'oscar.apps.dashboard.ranges.apps.RangesDashboardConfig',
293
+    'oscar.apps.dashboard.reviews.apps.ReviewsDashboardConfig',
294
+    'oscar.apps.dashboard.vouchers.apps.VouchersDashboardConfig',
295
+    'oscar.apps.dashboard.communications.apps.CommunicationsDashboardConfig',
296
+    'oscar.apps.dashboard.shipping.apps.ShippingDashboardConfig',
313 297
 
298
+    # 3rd-party apps that Oscar depends on
299
+    'widget_tweaks',
300
+    'haystack',
301
+    'treebeard',
302
+    'sorl.thumbnail',
303
+    'easy_thumbnails',
304
+    'django_tables2',
314 305
 
306
+    # Django apps that the sandbox depends on
307
+    'django.contrib.sitemaps',
315 308
 
309
+    # 3rd-party apps that the sandbox depends on
310
+    'django_extensions',
311
+    'debug_toolbar',
312
+    # "san"
313
+]
316 314
 
315
+# Add Oscar's custom auth backend so users can sign in using their email
316
+# address.
317
+AUTHENTICATION_BACKENDS = (
318
+    'oscar.apps.customer.auth_backends.EmailBackend',
319
+    'django.contrib.auth.backends.ModelBackend',
320
+)
317 321
 
322
+AUTH_PASSWORD_VALIDATORS = [
323
+    {
324
+        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
325
+        'OPTIONS': {
326
+            'min_length': 9,
327
+        }
328
+    },
329
+    {
330
+        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
331
+    },
332
+]
318 333
 
319 334
 
320
-# Internationalization
321
-# https://docs.djangoproject.com/en/4.2/topics/i18n/
322 335
 
323
-LANGUAGE_CODE = "en-us"
324 336
 
325
-TIME_ZONE = "UTC"
337
+LOGIN_REDIRECT_URL = '/'
338
+APPEND_SLASH = True
326 339
 
327
-USE_I18N = True
340
+# ====================
341
+# Messages contrib app
342
+# ====================
328 343
 
329
-USE_TZ = True
344
+from django.contrib.messages import constants as messages
345
+MESSAGE_TAGS = {
346
+    messages.ERROR: 'danger'
347
+}
330 348
 
349
+HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
331 350
 
332
-# Static files (CSS, JavaScript, Images)
333
-# https://docs.djangoproject.com/en/4.2/howto/static-files/
351
+# Woosh settings
352
+HAYSTACK_CONNECTIONS = {
353
+    'default': {
354
+        'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
355
+        'PATH': location('whoosh_index'),
356
+        'INCLUDE_SPELLING': True,
357
+    },
358
+}
334 359
 
360
+# Here's a sample Haystack config for Solr 6.x (which is recommended)
361
+# HAYSTACK_CONNECTIONS = {
362
+#     'default': {
363
+#         'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
364
+#         'URL': 'http://127.0.0.1:8983/solr/sandbox',
365
+#         'ADMIN_URL': 'http://127.0.0.1:8983/solr/admin/cores',
366
+#         'INCLUDE_SPELLING': True,
367
+#     }
368
+# }
335 369
 
336
-MEDIA_ROOT = location("public/media")
337
-STATIC_ROOT = location('public/static')
338
-MEDIA_URL = '/media/' #added
370
+# =============
371
+# Debug Toolbar
372
+# =============
339 373
 
340
-STATIC_URL = "static/"
374
+INTERNAL_IPS = ['127.0.0.1', '::1']
341 375
 
342
-# Default primary key field type
343
-# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
376
+# ==============
377
+# Oscar settings
378
+# ==============
379
+
380
+from oscar.defaults import *
381
+
382
+# Meta
383
+# ====
384
+
385
+OSCAR_SHOP_TAGLINE = 'Sandbox'
386
+
387
+OSCAR_RECENTLY_VIEWED_PRODUCTS = 20
388
+OSCAR_ALLOW_ANON_CHECKOUT = True
389
+
390
+
391
+# Order processing
392
+# ================
393
+
394
+# Sample order/line status settings. This is quite simplistic. It's like you'll
395
+# want to override the set_status method on the order object to do more
396
+# sophisticated things.
397
+OSCAR_INITIAL_ORDER_STATUS = 'Pending'
398
+OSCAR_INITIAL_LINE_STATUS = 'Pending'
399
+
400
+# This dict defines the new order statuses than an order can move to
401
+OSCAR_ORDER_STATUS_PIPELINE = {
402
+    'Pending': ('Being processed', 'Cancelled',),
403
+    'Being processed': ('Complete', 'Cancelled',),
404
+    'Cancelled': (),
405
+    'Complete': (),
406
+}
407
+
408
+# This dict defines the line statuses that will be set when an order's status
409
+# is changed
410
+OSCAR_ORDER_STATUS_CASCADE = {
411
+    'Being processed': 'Being processed',
412
+    'Cancelled': 'Cancelled',
413
+    'Complete': 'Shipped',
414
+}
344 415
 
345
-DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
416
+# Sorl
417
+# ====
418
+
419
+THUMBNAIL_DEBUG = DEBUG
420
+THUMBNAIL_KEY_PREFIX = 'oscar-sandbox'
421
+THUMBNAIL_KVSTORE = env(
422
+    'THUMBNAIL_KVSTORE',
423
+    default='sorl.thumbnail.kvstores.cached_db_kvstore.KVStore')
424
+THUMBNAIL_REDIS_URL = env('THUMBNAIL_REDIS_URL', default=None)
425
+
426
+
427
+# Django 1.6 has switched to JSON serializing for security reasons, but it does not
428
+# serialize Models. We should resolve this by extending the
429
+# django/core/serializers/json.Serializer to have the `dumps` function. Also
430
+# in tests/config.py
431
+SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'
432
+
433
+# Security
434
+SECURE_SSL_REDIRECT = env.bool('SECURE_SSL_REDIRECT', default=False)
435
+SECURE_HSTS_SECONDS = env.int('SECURE_HSTS_SECONDS', default=0)
436
+SECURE_CONTENT_TYPE_NOSNIFF = True
437
+SECURE_BROWSER_XSS_FILTER = True
438
+
439
+# Try and import local settings which can be used to override any of the above.
440
+try:
441
+    from settings_local import *
442
+except ImportError:
443
+    pass

Loading…
İptal
Kaydet