apis-acdhch-default-settings 1.5.0__tar.gz → 1.6.1__tar.gz
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-1.6.1/LICENSE +21 -0
- {apis_acdhch_default_settings-1.5.0 → apis_acdhch_default_settings-1.6.1}/PKG-INFO +1 -1
- {apis_acdhch_default_settings-1.5.0 → apis_acdhch_default_settings-1.6.1}/apis_acdhch_default_settings/settings.py +24 -13
- {apis_acdhch_default_settings-1.5.0 → apis_acdhch_default_settings-1.6.1}/pyproject.toml +1 -1
- {apis_acdhch_default_settings-1.5.0 → apis_acdhch_default_settings-1.6.1}/README.md +0 -0
- {apis_acdhch_default_settings-1.5.0 → apis_acdhch_default_settings-1.6.1}/apis_acdhch_default_settings/__init__.py +0 -0
- {apis_acdhch_default_settings-1.5.0 → apis_acdhch_default_settings-1.6.1}/apis_acdhch_default_settings/ldapauth.py +0 -0
- {apis_acdhch_default_settings-1.5.0 → apis_acdhch_default_settings-1.6.1}/apis_acdhch_default_settings/templates/base.html +0 -0
- {apis_acdhch_default_settings-1.5.0 → apis_acdhch_default_settings-1.6.1}/apis_acdhch_default_settings/templates/imprint.html +0 -0
- {apis_acdhch_default_settings-1.5.0 → apis_acdhch_default_settings-1.6.1}/apis_acdhch_default_settings/urls.py +0 -0
- {apis_acdhch_default_settings-1.5.0 → apis_acdhch_default_settings-1.6.1}/apis_acdhch_default_settings/utils.py +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023-2024 Austrian Centre for Digital Humanities at the Austrian Academy of Sciences
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -60,9 +60,9 @@ INSTALLED_APPS = [
|
|
|
60
60
|
"drf_spectacular",
|
|
61
61
|
]
|
|
62
62
|
|
|
63
|
-
# https://docs.djangoproject.com/en/
|
|
63
|
+
# https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-USE_X_FORWARDED_HOST
|
|
64
64
|
USE_X_FORWARDED_HOST = True
|
|
65
|
-
# https://docs.djangoproject.com/en/
|
|
65
|
+
# https://docs.djangoproject.com/en/stable/ref/settings/#secure-proxy-ssl-header
|
|
66
66
|
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
|
|
67
67
|
|
|
68
68
|
# drf-spectacular settings
|
|
@@ -121,7 +121,7 @@ REST_FRAMEWORK = {
|
|
|
121
121
|
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
# https://docs.djangoproject.com/en/
|
|
124
|
+
# https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-MIDDLEWARE
|
|
125
125
|
MIDDLEWARE = [
|
|
126
126
|
"allow_cidr.middleware.AllowCIDRMiddleware",
|
|
127
127
|
"django.middleware.security.SecurityMiddleware",
|
|
@@ -136,10 +136,10 @@ MIDDLEWARE = [
|
|
|
136
136
|
"crum.CurrentRequestUserMiddleware",
|
|
137
137
|
]
|
|
138
138
|
|
|
139
|
-
# https://docs.djangoproject.com/en/
|
|
139
|
+
# https://docs.djangoproject.com/en/stable/ref/settings/#root-urlconf
|
|
140
140
|
ROOT_URLCONF = "apis_acdhch_default_settings.urls"
|
|
141
141
|
|
|
142
|
-
# https://docs.djangoproject.com/en/
|
|
142
|
+
# https://docs.djangoproject.com/en/stable/ref/settings/#templates
|
|
143
143
|
TEMPLATES = [
|
|
144
144
|
{
|
|
145
145
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
@@ -156,7 +156,7 @@ TEMPLATES = [
|
|
|
156
156
|
}
|
|
157
157
|
]
|
|
158
158
|
|
|
159
|
-
# https://docs.djangoproject.com/en/
|
|
159
|
+
# https://docs.djangoproject.com/en/stable/ref/settings/#auth-password-validators
|
|
160
160
|
AUTH_PASSWORD_VALIDATORS = [
|
|
161
161
|
{"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"},
|
|
162
162
|
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
|
|
@@ -166,7 +166,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
|
|
166
166
|
|
|
167
167
|
|
|
168
168
|
# Internationalization
|
|
169
|
-
# https://docs.djangoproject.com/en/
|
|
169
|
+
# https://docs.djangoproject.com/en/stable/topics/i18n/
|
|
170
170
|
LANGUAGE_CODE = "en"
|
|
171
171
|
TIME_ZONE = "UTC"
|
|
172
172
|
USE_I18N = True
|
|
@@ -174,7 +174,7 @@ USE_L10N = True
|
|
|
174
174
|
USE_TZ = True
|
|
175
175
|
|
|
176
176
|
# Static files (CSS, JavaScript, Images)
|
|
177
|
-
# https://docs.djangoproject.com/en/
|
|
177
|
+
# https://docs.djangoproject.com/en/stable/howto/static-files/
|
|
178
178
|
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles/")
|
|
179
179
|
STATIC_URL = "/static/"
|
|
180
180
|
MEDIA_ROOT = os.path.join(BASE_DIR, "media/")
|
|
@@ -197,11 +197,11 @@ SHARED_URL = "https://shared.acdh.oeaw.ac.at/"
|
|
|
197
197
|
# https://github.com/mozmeao/django-allow-cidr
|
|
198
198
|
ALLOWED_CIDR_NETS = ["10.0.0.0/8", "127.0.0.0/8"]
|
|
199
199
|
|
|
200
|
-
# https://docs.djangoproject.com/en/
|
|
200
|
+
# https://docs.djangoproject.com/en/stable/ref/settings/#databases
|
|
201
201
|
# https://github.com/jazzband/dj-database-url
|
|
202
202
|
DATABASES = {'default': dj_database_url.config(default='sqlite:///db.sqlite3', conn_max_age=600)}
|
|
203
203
|
|
|
204
|
-
# https://docs.djangoproject.com/en/
|
|
204
|
+
# https://docs.djangoproject.com/en/stable/ref/settings/#allowed-hosts
|
|
205
205
|
ALLOWED_HOSTS = ["localhost", "127.0.0.1"]
|
|
206
206
|
if os.environ.get("PUBLIC_URL"):
|
|
207
207
|
ALLOWED_HOSTS.append(re.sub(r"https?://", "", os.environ.get("PUBLIC_URL")))
|
|
@@ -214,13 +214,13 @@ if os.environ.get("AUTH_LDAP_USER_LIST", False):
|
|
|
214
214
|
AUTH_LDAP_SERVER_URI = os.environ.get("ARZ_AUTH_LDAP_SERVER_URI")
|
|
215
215
|
AUTH_LDAP_USER_DN_TEMPLATE = "%(user)s@oeaw.ads"
|
|
216
216
|
|
|
217
|
-
# https://docs.djangoproject.com/en/
|
|
217
|
+
# https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-AUTHENTICATION_BACKENDS
|
|
218
218
|
AUTHENTICATION_BACKENDS = [
|
|
219
219
|
"apis_acdhch_default_settings.ldapauth.CustomLDAPBackend",
|
|
220
220
|
"django.contrib.auth.backends.ModelBackend",
|
|
221
221
|
]
|
|
222
222
|
|
|
223
|
-
# https://docs.djangoproject.com/en/
|
|
223
|
+
# https://docs.djangoproject.com/en/stable/howto/logging/
|
|
224
224
|
# setup logging to log everything to stdout
|
|
225
225
|
LOGGING = {
|
|
226
226
|
"version": 1,
|
|
@@ -242,7 +242,7 @@ LOGGING = {
|
|
|
242
242
|
},
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
# https://docs.djangoproject.com/en/
|
|
245
|
+
# https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-DEBUG
|
|
246
246
|
if debug := os.environ.get("DJANGO_DEBUG", False):
|
|
247
247
|
DEBUG = debug.lower() == "true"
|
|
248
248
|
|
|
@@ -251,3 +251,14 @@ if debug := os.environ.get("DJANGO_DEBUG", False):
|
|
|
251
251
|
# information to set the repository url in APIS
|
|
252
252
|
if os.environ.get("GITLAB_ENVIRONMENT_URL"):
|
|
253
253
|
GIT_REPOSITORY_URL = os.environ.get("GITLAB_ENVIRONMENT_URL")
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
# https://docs.djangoproject.com/en/stable/ref/settings/#login-url
|
|
257
|
+
# apis-core provides a login interface on /apis/accounts/login
|
|
258
|
+
# so we use that route as default login route
|
|
259
|
+
LOGIN_URL = "/apis/accounts/login"
|
|
260
|
+
|
|
261
|
+
# https://docs.djangoproject.com/en/stable/ref/settings/#login-redirect-url
|
|
262
|
+
# apis-core does not provide a view on `/accounts/profile` which is the
|
|
263
|
+
# default LOGIN_REDIRECT_URL, so we set it to `/`.
|
|
264
|
+
LOGIN_REDIRECT_URL = "/"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|