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