Add web/core/context_processors.py
This commit is contained in:
@@ -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}
|
||||||
Reference in New Issue
Block a user