|
@@ -0,0 +1,345 @@
|
|
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/
|
|
8
|
+
|
|
9
|
+For the full list of settings and their values, see
|
|
10
|
+https://docs.djangoproject.com/en/4.2/ref/settings/
|
|
11
|
+"""
|
|
12
|
+
|
|
13
|
+# print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
|
|
14
|
+
|
|
15
|
+from pathlib import Path
|
|
16
|
+import os
|
|
17
|
+
|
|
18
|
+from oscar.defaults import *
|
|
19
|
+location = lambda x: os.path.join(
|
|
20
|
+ os.path.dirname(os.path.realpath(__file__)), x)
|
|
21
|
+
|
|
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!
|
|
33
|
+DEBUG = True
|
|
34
|
+
|
|
35
|
+ALLOWED_HOSTS = ["*"]
|
|
36
|
+CSRF_TRUSTED_ORIGINS =["https://*.edanflor.com"]
|
|
37
|
+
|
|
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',
|
|
98
|
+
|
|
99
|
+ 'django_tables2',
|
|
100
|
+
|
|
101
|
+
|
|
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"
|
|
129
|
+
|
|
130
|
+TEMPLATES = [
|
|
131
|
+ {
|
|
132
|
+ "BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
133
|
+ "DIRS": [],
|
|
134
|
+ # "APP_DIRS": True,
|
|
135
|
+ "OPTIONS": {
|
|
136
|
+
|
|
137
|
+ 'loaders': [
|
|
138
|
+ 'django.template.loaders.filesystem.Loader',
|
|
139
|
+ 'django.template.loaders.app_directories.Loader',
|
|
140
|
+ ],
|
|
141
|
+
|
|
142
|
+ "context_processors": [
|
|
143
|
+ 'django.contrib.auth.context_processors.auth',
|
|
144
|
+ 'django.template.context_processors.request',
|
|
145
|
+ 'django.template.context_processors.debug',
|
|
146
|
+ 'django.template.context_processors.i18n',
|
|
147
|
+ 'django.template.context_processors.media',
|
|
148
|
+ 'django.template.context_processors.static',
|
|
149
|
+ 'django.contrib.messages.context_processors.messages',
|
|
150
|
+
|
|
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
|
+
|
|
156
|
+ 'oscar.apps.search.context_processors.search_form',
|
|
157
|
+ 'oscar.apps.checkout.context_processors.checkout',
|
|
158
|
+ 'oscar.apps.communication.notifications.context_processors.notifications',
|
|
159
|
+ 'oscar.core.context_processors.metadata',
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+ ],
|
|
163
|
+ '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
|
+
|
|
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
|
+ },
|
|
226
|
+]
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+LOGGING = {
|
|
236
|
+ 'version': 1,
|
|
237
|
+ 'disable_existing_loggers': True,
|
|
238
|
+ 'formatters': {
|
|
239
|
+ 'verbose': {
|
|
240
|
+ 'format': '%(levelname)s %(asctime)s %(module)s %(message)s',
|
|
241
|
+ },
|
|
242
|
+ 'simple': {
|
|
243
|
+ 'format': '[%(asctime)s] %(message)s'
|
|
244
|
+ },
|
|
245
|
+ },
|
|
246
|
+ 'root': {
|
|
247
|
+ 'level': 'DEBUG',
|
|
248
|
+ 'handlers': ['console'],
|
|
249
|
+ },
|
|
250
|
+ 'handlers': {
|
|
251
|
+ 'null': {
|
|
252
|
+ 'level': 'DEBUG',
|
|
253
|
+ 'class': 'logging.NullHandler',
|
|
254
|
+ },
|
|
255
|
+ 'console': {
|
|
256
|
+ 'level': 'DEBUG',
|
|
257
|
+ 'class': 'logging.StreamHandler',
|
|
258
|
+ 'formatter': 'simple'
|
|
259
|
+ },
|
|
260
|
+ },
|
|
261
|
+ 'loggers': {
|
|
262
|
+ 'oscar': {
|
|
263
|
+ 'level': 'DEBUG',
|
|
264
|
+ 'propagate': True,
|
|
265
|
+ },
|
|
266
|
+ 'oscar.catalogue.import': {
|
|
267
|
+ 'handlers': ['console'],
|
|
268
|
+ 'level': 'INFO',
|
|
269
|
+ 'propagate': False,
|
|
270
|
+ },
|
|
271
|
+ 'oscar.alerts': {
|
|
272
|
+ 'handlers': ['null'],
|
|
273
|
+ 'level': 'INFO',
|
|
274
|
+ 'propagate': False,
|
|
275
|
+ },
|
|
276
|
+
|
|
277
|
+ # Django loggers
|
|
278
|
+ 'django': {
|
|
279
|
+ 'handlers': ['null'],
|
|
280
|
+ 'propagate': True,
|
|
281
|
+ 'level': 'INFO',
|
|
282
|
+ },
|
|
283
|
+ 'django.request': {
|
|
284
|
+ 'handlers': ['console'],
|
|
285
|
+ 'level': 'ERROR',
|
|
286
|
+ 'propagate': True,
|
|
287
|
+ },
|
|
288
|
+ 'django.db.backends': {
|
|
289
|
+ 'level': 'WARNING',
|
|
290
|
+ 'propagate': True,
|
|
291
|
+ },
|
|
292
|
+ 'django.security.DisallowedHost': {
|
|
293
|
+ 'handlers': ['null'],
|
|
294
|
+ 'propagate': False,
|
|
295
|
+ },
|
|
296
|
+
|
|
297
|
+ # Third party
|
|
298
|
+ 'raven': {
|
|
299
|
+ 'level': 'DEBUG',
|
|
300
|
+ 'handlers': ['console'],
|
|
301
|
+ 'propagate': False,
|
|
302
|
+ },
|
|
303
|
+ 'sorl.thumbnail': {
|
|
304
|
+ 'handlers': ['console'],
|
|
305
|
+ 'propagate': True,
|
|
306
|
+ 'level': 'INFO',
|
|
307
|
+ },
|
|
308
|
+ }
|
|
309
|
+}
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+# Internationalization
|
|
321
|
+# https://docs.djangoproject.com/en/4.2/topics/i18n/
|
|
322
|
+
|
|
323
|
+LANGUAGE_CODE = "en-us"
|
|
324
|
+
|
|
325
|
+TIME_ZONE = "UTC"
|
|
326
|
+
|
|
327
|
+USE_I18N = True
|
|
328
|
+
|
|
329
|
+USE_TZ = True
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+# Static files (CSS, JavaScript, Images)
|
|
333
|
+# https://docs.djangoproject.com/en/4.2/howto/static-files/
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+MEDIA_ROOT = location("public/media")
|
|
337
|
+STATIC_ROOT = location('public/static')
|
|
338
|
+MEDIA_URL = '/media/' #added
|
|
339
|
+
|
|
340
|
+STATIC_URL = "static/"
|
|
341
|
+
|
|
342
|
+# Default primary key field type
|
|
343
|
+# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
|
|
344
|
+
|
|
345
|
+DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|