Add web/core/context_processors.py
This commit is contained in:
parent
edf5711db2
commit
f246c5ec1e
10
web/core/context_processors.py
Normal file
10
web/core/context_processors.py
Normal file
@ -0,0 +1,10 @@
|
||||
from pathlib import Path
|
||||
|
||||
def app_version(request):
|
||||
version_file = Path(__file__).resolve().parent.parent / "/web/version.txt"
|
||||
try:
|
||||
with open(version_file, "r") as f:
|
||||
version = f.read().strip()
|
||||
except FileNotFoundError:
|
||||
version = "v0.0.0"
|
||||
return {"APP_VERSION": version}
|
||||
Loading…
Reference in New Issue
Block a user