Skip to content

Commit dedf5bc

Browse files
committed
Added version to home page.
1 parent b1725a5 commit dedf5bc

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

track/templates/track/home.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ <h3 class="float-md-start mb-0">eDROP</h3>
134134

135135
<main class="px-3">
136136
<h1>eDROP Connector</h1>
137-
<p class="lead">More to come...</p>
137+
<p class="lead">Version: {{ version }}</p>
138138
<!--<p class="lead">
139139
<a href="#" class="btn btn-lg btn-light fw-bold border-white bg-white">Learn more</a>
140140
</p>-->

track/views.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,16 @@
55

66
def index(request):
77
template = "track/home.html"
8-
context = {}
8+
# if there is a version file (which there should be after deployment)
9+
# we'll show this on the home page
10+
try:
11+
with open('edrop/static/VERSION.txt', 'r') as file:
12+
context = {
13+
'version': file.read()
14+
}
15+
except Exception as ex:
16+
logger.error("Could not get version.")
17+
logger.error(ex)
18+
context = {}
19+
920
return render(request, template, context)

0 commit comments

Comments
 (0)