diff --git a/web/core/context_processors.py b/web/core/context_processors.py new file mode 100644 index 0000000..cd5bc05 --- /dev/null +++ b/web/core/context_processors.py @@ -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} \ No newline at end of file