Skip to content

Commit b1bcf69

Browse files
committed
tech: add utils/deployment-infos/ endpoint
1 parent 4a928a0 commit b1bcf69

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ celerybeat.pid
136136
.env.compose
137137
.env.develop
138138
.env.prod
139+
.env.preprod
139140
.venv
140141
env/
141142
venv/

aigle/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
https://docs.djangoproject.com/en/5.0/ref/settings/
1111
"""
1212

13-
from datetime import timedelta
13+
from datetime import timedelta, datetime
1414
import os
1515
from pathlib import Path
1616

1717
from core.utils.parsing import strtobool
1818

19+
DEPLOYMENT_DATETIME = datetime.now()
20+
1921
# Build paths inside the project like this: BASE_DIR / 'subdir'.
2022
BASE_DIR = Path(__file__).resolve().parent.parent
2123

core/views/utils/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from django.urls import path
2+
3+
from core.views.utils import deploy_infos
24
from . import get_tile_view
35
from . import get_import_infos
46
from . import get_custom_geometry
@@ -10,6 +12,7 @@
1012
urls = [
1113
path(f"{URL_PREFIX}{view.URL}", view.endpoint, name=view.URL)
1214
for view in [
15+
deploy_infos,
1316
get_tile_view,
1417
get_import_infos,
1518
get_custom_geometry,

core/views/utils/deploy_infos.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from django.http import JsonResponse
2+
3+
4+
from aigle.settings import DEPLOYMENT_DATETIME
5+
6+
7+
def endpoint():
8+
return JsonResponse({"datetime": str(DEPLOYMENT_DATETIME)})
9+
10+
11+
URL = "deployment-infos/"

0 commit comments

Comments
 (0)