apis-acdhch-default-settings 1.1.2__py3-none-any.whl → 1.2.1__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 +7 -1
- apis_acdhch_default_settings/templates/base.html +5 -0
- apis_acdhch_default_settings/templates/imprint.html +11 -0
- apis_acdhch_default_settings/urls.py +3 -0
- apis_acdhch_default_settings/utils.py +22 -0
- {apis_acdhch_default_settings-1.1.2.dist-info → apis_acdhch_default_settings-1.2.1.dist-info}/METADATA +1 -1
- apis_acdhch_default_settings-1.2.1.dist-info/RECORD +10 -0
- apis_acdhch_default_settings-1.1.2.dist-info/RECORD +0 -7
- {apis_acdhch_default_settings-1.1.2.dist-info → apis_acdhch_default_settings-1.2.1.dist-info}/WHEEL +0 -0
|
@@ -49,6 +49,7 @@ INSTALLED_APPS = [
|
|
|
49
49
|
"django_tables2",
|
|
50
50
|
"rest_framework",
|
|
51
51
|
"apis_ontology",
|
|
52
|
+
"apis_acdhch_default_settings",
|
|
52
53
|
"apis_core.apis_relations",
|
|
53
54
|
"apis_core.apis_entities",
|
|
54
55
|
"apis_core.apis_metainfo",
|
|
@@ -57,7 +58,6 @@ INSTALLED_APPS = [
|
|
|
57
58
|
"apis_core.core",
|
|
58
59
|
"rest_framework.authtoken",
|
|
59
60
|
"drf_spectacular",
|
|
60
|
-
"csvexport",
|
|
61
61
|
]
|
|
62
62
|
|
|
63
63
|
# https://docs.djangoproject.com/en/5.0/ref/settings/#std-setting-USE_X_FORWARDED_HOST
|
|
@@ -240,3 +240,9 @@ LOGGING = {
|
|
|
240
240
|
"level": "DEBUG",
|
|
241
241
|
},
|
|
242
242
|
}
|
|
243
|
+
|
|
244
|
+
# Our deployment infrastructure sets the GITLAB_ENVIRONMENT_URL to the
|
|
245
|
+
# repository from which the instance is deployed. Lets reuse this
|
|
246
|
+
# information to set the repository url in APIS
|
|
247
|
+
if os.environ.get("GITLAB_ENVIRONMENT_URL"):
|
|
248
|
+
GIT_REPOSITORY_URL = os.environ.get("GITLAB_ENVIRONMENT_URL")
|
|
@@ -4,6 +4,8 @@ from django.contrib import admin
|
|
|
4
4
|
from django.urls import path
|
|
5
5
|
from django.views.generic import TemplateView
|
|
6
6
|
|
|
7
|
+
from apis_acdhch_default_settings import utils
|
|
8
|
+
|
|
7
9
|
from apis_core.apis_entities.api_views import GetEntityGeneric
|
|
8
10
|
|
|
9
11
|
urlpatterns = [
|
|
@@ -25,3 +27,4 @@ if "apis_bibsonomy" in settings.INSTALLED_APPS:
|
|
|
25
27
|
)
|
|
26
28
|
|
|
27
29
|
urlpatterns.append(path("", TemplateView.as_view(template_name="base.html")))
|
|
30
|
+
urlpatterns.append(path("imprint", TemplateView.as_view(template_name="imprint.html", extra_context={"imprint": utils.get_imprint()}), name="imprint"))
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import functools
|
|
2
|
+
import requests
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
from django.conf import settings
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@functools.cache
|
|
9
|
+
def get_imprint() -> str:
|
|
10
|
+
base_url = getattr(settings, "ACDH_IMPRINT_URL", "https://imprint.acdh.oeaw.ac.at/")
|
|
11
|
+
redmine_id = getattr(settings, "REDMINE_ID", os.getenv("SERVICE_ID", ""))
|
|
12
|
+
|
|
13
|
+
r = requests.get(f"{base_url}{redmine_id}")
|
|
14
|
+
|
|
15
|
+
if r and redmine_id:
|
|
16
|
+
return r.text
|
|
17
|
+
else:
|
|
18
|
+
return """
|
|
19
|
+
One of our services is currently not available. Please try it later or write
|
|
20
|
+
an email to acdh@oeaw.ac.at; if you are service provider, make sure that you
|
|
21
|
+
provided ACDH_IMPRINT_URL and REDMINE_ID.
|
|
22
|
+
"""
|
|
@@ -0,0 +1,10 @@
|
|
|
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=5ukcsdhzeMM6YetMkyPyFX1nEFZkiOfFdBlsJnPpWxo,8472
|
|
4
|
+
apis_acdhch_default_settings/templates/base.html,sha256=VLwQAp2NpxLy6V_tH52_LZ1SZE0hoy8zwN6P--ZoNZs,148
|
|
5
|
+
apis_acdhch_default_settings/templates/imprint.html,sha256=juOqq6yzT9FMhjPjhbofDPZxRNO2fhOLlS478reFjE0,254
|
|
6
|
+
apis_acdhch_default_settings/urls.py,sha256=A-luu7RnoGEDf-aEkFj2ybBtbsz3mlXsQdyzVr74NeI,1146
|
|
7
|
+
apis_acdhch_default_settings/utils.py,sha256=9uh0oQMPirTYvGxMg1f8IrOqrsxdxa8UgDJOrZaJdPs,647
|
|
8
|
+
apis_acdhch_default_settings-1.2.1.dist-info/METADATA,sha256=9_HklyqJ7ujYjVzXUqfgHqy_4RT7RPZNtJGVXPDKYYw,903
|
|
9
|
+
apis_acdhch_default_settings-1.2.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
10
|
+
apis_acdhch_default_settings-1.2.1.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=X8CKo2sUP0VhqhGqaULl1wBEsdu_FjakISsIONH2sk4,8156
|
|
4
|
-
apis_acdhch_default_settings/urls.py,sha256=VDvjdb940573U-xuwGYwYZTJJRgTeSgnlNCm7Hj8kGs,946
|
|
5
|
-
apis_acdhch_default_settings-1.1.2.dist-info/METADATA,sha256=8w4HspoBgYC4x6-1ECsxnx_ipYbWDYF-aXS6xCSXr4o,903
|
|
6
|
-
apis_acdhch_default_settings-1.1.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
7
|
-
apis_acdhch_default_settings-1.1.2.dist-info/RECORD,,
|
{apis_acdhch_default_settings-1.1.2.dist-info → apis_acdhch_default_settings-1.2.1.dist-info}/WHEEL
RENAMED
|
File without changes
|