apis-acdhch-default-settings 0.1.24__py3-none-any.whl → 1.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- apis_acdhch_default_settings/settings.py +56 -136
- {apis_acdhch_default_settings-0.1.24.dist-info → apis_acdhch_default_settings-1.1.0.dist-info}/METADATA +1 -1
- apis_acdhch_default_settings-1.1.0.dist-info/RECORD +7 -0
- {apis_acdhch_default_settings-0.1.24.dist-info → apis_acdhch_default_settings-1.1.0.dist-info}/WHEEL +1 -1
- apis_acdhch_default_settings-0.1.24.dist-info/RECORD +0 -7
|
@@ -30,41 +30,11 @@ BASE_DIR = os.path.dirname(
|
|
|
30
30
|
os.path.dirname(os.path.abspath(os.path.join(__file__, "../")))
|
|
31
31
|
)
|
|
32
32
|
|
|
33
|
-
SHARED_URL = "https://shared.acdh.oeaw.ac.at/"
|
|
34
|
-
|
|
35
|
-
PROJECT_NAME = "apis"
|
|
36
|
-
PROJECT_SHARED = "https://shared.acdh.oeaw.ac.at/apis/"
|
|
37
|
-
PROJECT_DEFAULT_MD = {
|
|
38
|
-
"title": "TITLE",
|
|
39
|
-
"author": "Matthias Schlögl, Peter Andorfer",
|
|
40
|
-
"subtitle": "SUBTITLE",
|
|
41
|
-
"description": """This is a default metadata file. To change this, provide\
|
|
42
|
-
provide a following file {PROJECT_SHARED}/{PROJECT_NAME}/metadata.json""",
|
|
43
|
-
"github": "https://github.com/acdh-oeaw/apis-webpage-base",
|
|
44
|
-
"production instance": None,
|
|
45
|
-
"purpose_de": "",
|
|
46
|
-
"purpose_en": """""",
|
|
47
|
-
"version": ["apis_core", "charts", "django"],
|
|
48
|
-
"matomo_id": "",
|
|
49
|
-
"matomo_url": "",
|
|
50
|
-
"imprint": "/imprint",
|
|
51
|
-
"social_media": [
|
|
52
|
-
("fab fa-twitter", "https://twitter.com/ACDH_OeAW"),
|
|
53
|
-
("fab fa-youtube", "https://www.youtube.com/channel/UCgaEMaMbPkULYRI5u6gvG-w"),
|
|
54
|
-
],
|
|
55
|
-
"social_media": [
|
|
56
|
-
("fab fa-twitter fa-2x", "https://twitter.com/ACDH_OeAW"),
|
|
57
|
-
(
|
|
58
|
-
"fab fa-youtube fa-2x",
|
|
59
|
-
"https://www.youtube.com/channel/UCgaEMaMbPkULYRI5u6gvG-w",
|
|
60
|
-
),
|
|
61
|
-
],
|
|
62
|
-
"app_type": "database",
|
|
63
|
-
}
|
|
64
|
-
|
|
65
33
|
# Application definition
|
|
66
|
-
|
|
34
|
+
# put apis_override_select2js at the beginning of the list
|
|
35
|
+
# to make its static files weigh more than from the other apps
|
|
67
36
|
INSTALLED_APPS = [
|
|
37
|
+
"apis_override_select2js",
|
|
68
38
|
"dal",
|
|
69
39
|
"dal_select2",
|
|
70
40
|
"django.contrib.admin",
|
|
@@ -73,7 +43,6 @@ INSTALLED_APPS = [
|
|
|
73
43
|
"django.contrib.sessions",
|
|
74
44
|
"django.contrib.messages",
|
|
75
45
|
"django.contrib.staticfiles",
|
|
76
|
-
"reversion",
|
|
77
46
|
"crispy_forms",
|
|
78
47
|
"crispy_bootstrap4",
|
|
79
48
|
"django_filters",
|
|
@@ -86,27 +55,28 @@ INSTALLED_APPS = [
|
|
|
86
55
|
"apis_core.apis_vocabularies",
|
|
87
56
|
"apis_core.generic",
|
|
88
57
|
"rest_framework.authtoken",
|
|
89
|
-
# "drf_yasg",
|
|
90
58
|
"drf_spectacular",
|
|
91
59
|
"csvexport",
|
|
92
60
|
"apis_ontology",
|
|
93
61
|
]
|
|
94
62
|
|
|
95
|
-
#
|
|
96
|
-
# to make its static files weigh more than from the other apps
|
|
97
|
-
INSTALLED_APPS = ["apis_override_select2js"] + INSTALLED_APPS
|
|
98
|
-
|
|
63
|
+
# https://docs.djangoproject.com/en/5.0/ref/settings/#std-setting-USE_X_FORWARDED_HOST
|
|
99
64
|
USE_X_FORWARDED_HOST = True
|
|
65
|
+
# https://docs.djangoproject.com/en/5.0/ref/settings/#secure-proxy-ssl-header
|
|
100
66
|
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
|
|
101
67
|
|
|
68
|
+
# drf-spectacular settings
|
|
69
|
+
# https://drf-spectacular.readthedocs.io/en/latest/settings.html
|
|
102
70
|
SPECTACULAR_SETTINGS: Dict[str, Any] = {
|
|
103
71
|
"TITLE": "APIS generic API",
|
|
104
72
|
"DESCRIPTIOPN": "Provides access to the main APIS data-model endpoints.",
|
|
105
73
|
"LICENSE": {"name": "MIT License", "url": "https://www.mit.edu/~amini/LICENSE.md"},
|
|
106
74
|
"VERSION": "0.13",
|
|
75
|
+
"DEFAULT_GENERATOR_CLASS": 'apis_core.generic.generators.CustomSchemaGenerator'
|
|
107
76
|
}
|
|
108
77
|
|
|
109
|
-
|
|
78
|
+
# django-csp settings
|
|
79
|
+
# https://django-csp.readthedocs.io/en/latest/migration-guide.html#migration-guide-chapter
|
|
110
80
|
CSP_DEFAULT_SRC = (
|
|
111
81
|
"'self'",
|
|
112
82
|
"'unsafe-inline'",
|
|
@@ -127,8 +97,12 @@ CSP_DEFAULT_SRC = (
|
|
|
127
97
|
)
|
|
128
98
|
CSP_FRAME_SRC = ("sennierer.github.io",)
|
|
129
99
|
|
|
100
|
+
# django-crispy-forms settings
|
|
101
|
+
# https://django-crispy-forms.readthedocs.io/en/latest/install.html#template-packs
|
|
130
102
|
CRISPY_TEMPLATE_PACK = "bootstrap4"
|
|
131
103
|
|
|
104
|
+
# django-rest-framework settings
|
|
105
|
+
# https://www.django-rest-framework.org/api-guide/settings/
|
|
132
106
|
REST_FRAMEWORK = {
|
|
133
107
|
"DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.LimitOffsetPagination",
|
|
134
108
|
"PAGE_SIZE": 50,
|
|
@@ -147,10 +121,7 @@ REST_FRAMEWORK = {
|
|
|
147
121
|
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
|
|
148
122
|
}
|
|
149
123
|
|
|
150
|
-
|
|
151
|
-
"django.contrib.auth.backends.ModelBackend", # this is default
|
|
152
|
-
)
|
|
153
|
-
|
|
124
|
+
# https://docs.djangoproject.com/en/5.0/ref/settings/#std-setting-MIDDLEWARE
|
|
154
125
|
MIDDLEWARE = [
|
|
155
126
|
"allow_cidr.middleware.AllowCIDRMiddleware",
|
|
156
127
|
"django.middleware.security.SecurityMiddleware",
|
|
@@ -160,13 +131,15 @@ MIDDLEWARE = [
|
|
|
160
131
|
"django.middleware.csrf.CsrfViewMiddleware",
|
|
161
132
|
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
|
162
133
|
"django.contrib.messages.middleware.MessageMiddleware",
|
|
134
|
+
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
|
163
135
|
"csp.middleware.CSPMiddleware",
|
|
164
|
-
"reversion.middleware.RevisionMiddleware",
|
|
165
136
|
"crum.CurrentRequestUserMiddleware",
|
|
166
137
|
]
|
|
167
138
|
|
|
139
|
+
# https://docs.djangoproject.com/en/5.0/ref/settings/#root-urlconf
|
|
168
140
|
ROOT_URLCONF = "apis_acdhch_default_settings.urls"
|
|
169
141
|
|
|
142
|
+
# https://docs.djangoproject.com/en/5.0/ref/settings/#templates
|
|
170
143
|
TEMPLATES = [
|
|
171
144
|
{
|
|
172
145
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
@@ -183,128 +156,51 @@ TEMPLATES = [
|
|
|
183
156
|
}
|
|
184
157
|
]
|
|
185
158
|
|
|
186
|
-
#
|
|
187
|
-
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
|
|
188
|
-
|
|
159
|
+
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
|
|
189
160
|
AUTH_PASSWORD_VALIDATORS = [
|
|
190
|
-
{
|
|
191
|
-
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"
|
|
192
|
-
},
|
|
161
|
+
{"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"},
|
|
193
162
|
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
|
|
194
163
|
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
|
|
195
164
|
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
|
|
196
165
|
]
|
|
197
166
|
|
|
198
|
-
APIS_BASE_URI = "TO CHANGE"
|
|
199
|
-
|
|
200
|
-
APIS_MIN_CHAR = 0
|
|
201
167
|
|
|
202
168
|
# Internationalization
|
|
203
169
|
# https://docs.djangoproject.com/en/1.11/topics/i18n/
|
|
204
|
-
|
|
205
170
|
LANGUAGE_CODE = "en"
|
|
206
|
-
|
|
207
171
|
TIME_ZONE = "UTC"
|
|
208
|
-
|
|
209
172
|
USE_I18N = True
|
|
210
|
-
|
|
211
173
|
USE_L10N = True
|
|
212
|
-
|
|
213
174
|
USE_TZ = True
|
|
214
175
|
|
|
215
|
-
|
|
216
176
|
# Static files (CSS, JavaScript, Images)
|
|
217
177
|
# https://docs.djangoproject.com/en/1.11/howto/static-files/
|
|
218
|
-
|
|
219
178
|
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles/")
|
|
220
179
|
STATIC_URL = "/static/"
|
|
221
180
|
MEDIA_ROOT = os.path.join(BASE_DIR, "media/")
|
|
222
181
|
MEDIA_URL = "/media/"
|
|
223
182
|
|
|
183
|
+
# django-tables2 setting
|
|
184
|
+
# https://django-tables2.readthedocs.io/en/latest/pages/custom-rendering.html#available-templates
|
|
224
185
|
DJANGO_TABLES2_TEMPLATE = "django_tables2/bootstrap4.html"
|
|
225
186
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
APIS_TEI_TEXTS = ["xml/tei transcription"]
|
|
230
|
-
APIS_CETEICEAN_CSS = "https://teic.github.io/CETEIcean/css/CETEIcean.css"
|
|
231
|
-
APIS_CETEICEAN_JS = "https://teic.github.io/CETEIcean/js/CETEI.js"
|
|
232
|
-
|
|
187
|
+
# apis-core-rdf settings
|
|
188
|
+
APIS_BASE_URI = "TO CHANGE"
|
|
189
|
+
APIS_MIN_CHAR = 0
|
|
233
190
|
APIS_NEXT_PREV = True
|
|
234
|
-
|
|
235
|
-
APIS_ALTERNATE_NAMES = [
|
|
236
|
-
"Taufname",
|
|
237
|
-
"Ehename",
|
|
238
|
-
"Name laut ÖBL XML",
|
|
239
|
-
"alternative Namensform",
|
|
240
|
-
"alternative name",
|
|
241
|
-
"Künstlername",
|
|
242
|
-
"Mädchenname",
|
|
243
|
-
"Pseudonym",
|
|
244
|
-
"weitere Namensform",
|
|
245
|
-
]
|
|
246
|
-
|
|
247
|
-
APIS_RELATIONS_FILTER_EXCLUDE = [
|
|
248
|
-
"*uri*",
|
|
249
|
-
"*tempentityclass*",
|
|
250
|
-
"user",
|
|
251
|
-
"*__id",
|
|
252
|
-
"*source*",
|
|
253
|
-
"label",
|
|
254
|
-
"*temp_entity*",
|
|
255
|
-
"*collection*",
|
|
256
|
-
"*published*",
|
|
257
|
-
"*_set",
|
|
258
|
-
"*_set__*",
|
|
259
|
-
"_ptr",
|
|
260
|
-
"baseclass",
|
|
261
|
-
"*id",
|
|
262
|
-
"*written*",
|
|
263
|
-
"relation_type__*",
|
|
264
|
-
"*__text*",
|
|
265
|
-
"text*",
|
|
266
|
-
"*annotation_set_relation*",
|
|
267
|
-
"*start_start_date*",
|
|
268
|
-
"*end_end_date*",
|
|
269
|
-
"*start_end_date*",
|
|
270
|
-
"*end_start_date*",
|
|
271
|
-
"*label*",
|
|
272
|
-
"*review*",
|
|
273
|
-
"*__name",
|
|
274
|
-
"*__status",
|
|
275
|
-
"*__references",
|
|
276
|
-
"*__notes",
|
|
277
|
-
]
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
APIS_VOCABULARIES = {"exclude": ["userAdded"]}
|
|
282
|
-
|
|
283
|
-
APIS_METAINFO = {"exclude": ["groups_allowed"]}
|
|
284
|
-
|
|
285
|
-
# TODO RDF: Remove this dictionary from settings entirely and attach it only to entity models
|
|
286
|
-
APIS_ENTITIES = {}
|
|
287
|
-
|
|
288
|
-
APIS_API_EXCLUDE_SETS = True # exclude reverse links to entities
|
|
289
|
-
|
|
290
191
|
APIS_LIST_VIEWS_ALLOWED = False
|
|
291
192
|
APIS_DETAIL_VIEWS_ALLOWED = False
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
APIS_IIIF_WORK_KIND = "IIIF"
|
|
295
|
-
APIS_IIIF_ENT_IIIF_REL = "has iiif image"
|
|
296
|
-
APIS_IIIF_SERVER = "https://iiif.acdh.oeaw.ac.at/"
|
|
297
|
-
APIS_OSD_JS = (
|
|
298
|
-
"https://cdnjs.cloudflare.com/ajax/libs/openseadragon/2.4.0/openseadragon.min.js"
|
|
299
|
-
)
|
|
300
|
-
APIS_OSD_IMG_PREFIX = (
|
|
301
|
-
"https://cdnjs.cloudflare.com/ajax/libs/openseadragon/2.4.0/images/"
|
|
302
|
-
)
|
|
193
|
+
SHARED_URL = "https://shared.acdh.oeaw.ac.at/"
|
|
303
194
|
|
|
195
|
+
# django-allow-cidr settings
|
|
196
|
+
# https://github.com/mozmeao/django-allow-cidr
|
|
304
197
|
ALLOWED_CIDR_NETS = ["10.0.0.0/8", "127.0.0.0/8"]
|
|
305
198
|
|
|
306
|
-
|
|
199
|
+
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
|
|
200
|
+
# https://github.com/jazzband/dj-database-url
|
|
201
|
+
DATABASES = {'default': dj_database_url.config(default='sqlite:///db.sqlite3', conn_max_age=600)}
|
|
307
202
|
|
|
203
|
+
# https://docs.djangoproject.com/en/5.0/ref/settings/#allowed-hosts
|
|
308
204
|
ALLOWED_HOSTS = ["localhost", "127.0.0.1"]
|
|
309
205
|
if os.environ.get("PUBLIC_URL"):
|
|
310
206
|
ALLOWED_HOSTS.append(re.sub(r"https?://", "", os.environ.get("PUBLIC_URL")))
|
|
@@ -312,11 +208,35 @@ if os.environ.get("PUBLIC_URL"):
|
|
|
312
208
|
if os.environ.get("ALLOWED_HOSTS"):
|
|
313
209
|
ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS").split(",")
|
|
314
210
|
|
|
211
|
+
# setting of apis_acdhch_default_settings.ldapauth
|
|
315
212
|
if os.environ.get("AUTH_LDAP_USER_LIST", False):
|
|
316
213
|
AUTH_LDAP_SERVER_URI = os.environ.get("ARZ_AUTH_LDAP_SERVER_URI")
|
|
317
214
|
AUTH_LDAP_USER_DN_TEMPLATE = "%(user)s@oeaw.ads"
|
|
318
215
|
|
|
216
|
+
# https://docs.djangoproject.com/en/5.0/ref/settings/#std-setting-AUTHENTICATION_BACKENDS
|
|
319
217
|
AUTHENTICATION_BACKENDS = [
|
|
320
218
|
"apis_acdhch_default_settings.ldapauth.CustomLDAPBackend",
|
|
321
219
|
"django.contrib.auth.backends.ModelBackend",
|
|
322
220
|
]
|
|
221
|
+
|
|
222
|
+
# https://docs.djangoproject.com/en/5.0/howto/logging/
|
|
223
|
+
# setup logging to log everything to stdout
|
|
224
|
+
LOGGING = {
|
|
225
|
+
"version": 1,
|
|
226
|
+
"disable_existing_loggers": False,
|
|
227
|
+
'formatters': {
|
|
228
|
+
'verbose': {
|
|
229
|
+
'format': '%(asctime)s %(name)-6s %(levelname)-8s %(message)s',
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
"handlers": {
|
|
233
|
+
"console": {
|
|
234
|
+
"class": "logging.StreamHandler",
|
|
235
|
+
"formatter": "verbose",
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
"root": {
|
|
239
|
+
"handlers": ["console"],
|
|
240
|
+
"level": "DEBUG",
|
|
241
|
+
},
|
|
242
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
apis_acdhch_default_settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
apis_acdhch_default_settings/ldapauth.py,sha256=P1NDgWG2Pp4JzqoETq3VDC3DtECoEIXWBA3Lzn6CUIA,423
|
|
3
|
+
apis_acdhch_default_settings/settings.py,sha256=iW-8jaS8tvlbOJXgkwjGwKHU9rGi2Gb4vqVCqCa_TSU,8156
|
|
4
|
+
apis_acdhch_default_settings/urls.py,sha256=VDvjdb940573U-xuwGYwYZTJJRgTeSgnlNCm7Hj8kGs,946
|
|
5
|
+
apis_acdhch_default_settings-1.1.0.dist-info/METADATA,sha256=54SYuZtpTIaA4NVq914P1e9tRGt9mDRC9vwlij-5rDg,903
|
|
6
|
+
apis_acdhch_default_settings-1.1.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
7
|
+
apis_acdhch_default_settings-1.1.0.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
apis_acdhch_default_settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
apis_acdhch_default_settings/ldapauth.py,sha256=P1NDgWG2Pp4JzqoETq3VDC3DtECoEIXWBA3Lzn6CUIA,423
|
|
3
|
-
apis_acdhch_default_settings/settings.py,sha256=OaAxi-UHH_pyNS3fEYXEcMJ3k70_5i0MmDqZQktLscY,9108
|
|
4
|
-
apis_acdhch_default_settings/urls.py,sha256=VDvjdb940573U-xuwGYwYZTJJRgTeSgnlNCm7Hj8kGs,946
|
|
5
|
-
apis_acdhch_default_settings-0.1.24.dist-info/METADATA,sha256=IIvdpPYUk8Az__OQy84w8SbIh1EQ6oJx_rvnt9pfyDE,904
|
|
6
|
-
apis_acdhch_default_settings-0.1.24.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
7
|
-
apis_acdhch_default_settings-0.1.24.dist-info/RECORD,,
|