apis-acdhch-default-settings 1.4.0__tar.gz → 1.6.0__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.4.0 → apis_acdhch_default_settings-1.6.0}/PKG-INFO +1 -1
- {apis_acdhch_default_settings-1.4.0 → apis_acdhch_default_settings-1.6.0}/apis_acdhch_default_settings/settings.py +22 -12
- {apis_acdhch_default_settings-1.4.0 → apis_acdhch_default_settings-1.6.0}/apis_acdhch_default_settings/urls.py +0 -4
- {apis_acdhch_default_settings-1.4.0 → apis_acdhch_default_settings-1.6.0}/pyproject.toml +1 -1
- {apis_acdhch_default_settings-1.4.0 → apis_acdhch_default_settings-1.6.0}/README.md +0 -0
- {apis_acdhch_default_settings-1.4.0 → apis_acdhch_default_settings-1.6.0}/apis_acdhch_default_settings/__init__.py +0 -0
- {apis_acdhch_default_settings-1.4.0 → apis_acdhch_default_settings-1.6.0}/apis_acdhch_default_settings/ldapauth.py +0 -0
- {apis_acdhch_default_settings-1.4.0 → apis_acdhch_default_settings-1.6.0}/apis_acdhch_default_settings/templates/base.html +0 -0
- {apis_acdhch_default_settings-1.4.0 → apis_acdhch_default_settings-1.6.0}/apis_acdhch_default_settings/templates/imprint.html +0 -0
- {apis_acdhch_default_settings-1.4.0 → apis_acdhch_default_settings-1.6.0}/apis_acdhch_default_settings/utils.py +0 -0
|
@@ -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,8 +242,18 @@ LOGGING = {
|
|
|
242
242
|
},
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
+
# https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-DEBUG
|
|
246
|
+
if debug := os.environ.get("DJANGO_DEBUG", False):
|
|
247
|
+
DEBUG = debug.lower() == "true"
|
|
248
|
+
|
|
245
249
|
# Our deployment infrastructure sets the GITLAB_ENVIRONMENT_URL to the
|
|
246
250
|
# repository from which the instance is deployed. Lets reuse this
|
|
247
251
|
# information to set the repository url in APIS
|
|
248
252
|
if os.environ.get("GITLAB_ENVIRONMENT_URL"):
|
|
249
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"
|
|
@@ -17,10 +17,6 @@ urlpatterns = [
|
|
|
17
17
|
path("admin/", admin.site.urls),
|
|
18
18
|
]
|
|
19
19
|
|
|
20
|
-
if "webpage" in settings.INSTALLED_APPS:
|
|
21
|
-
urlpatterns.append(path("", include("webpage.urls", namespace="webpage")))
|
|
22
|
-
handler404 = "webpage.views.handler404"
|
|
23
|
-
|
|
24
20
|
if "apis_bibsonomy" in settings.INSTALLED_APPS:
|
|
25
21
|
urlpatterns.append(
|
|
26
22
|
path("bibsonomy/", include("apis_bibsonomy.urls", namespace="bibsonomy"))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|