From 452a7a4a34774e893e3a47415dec02042e142932 Mon Sep 17 00:00:00 2001 From: Kirosbr Date: Sun, 21 Jul 2024 04:18:16 +0200 Subject: [PATCH] ajout du fichier version --- Reskreen/settings.py | 12 ++++++++++-- VERSION | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 VERSION diff --git a/Reskreen/settings.py b/Reskreen/settings.py index 484242e..1785e3c 100644 --- a/Reskreen/settings.py +++ b/Reskreen/settings.py @@ -17,6 +17,14 @@ from config.server_config import * # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent +VERSION_FILE_PATH = os.path.join(BASE_DIR, 'version') + +try: + with open(VERSION_FILE_PATH) as version_file: + VERSION = version_file.read().strip() +except FileNotFoundError: + VERSION = "unknown" + # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ @@ -221,10 +229,10 @@ JAZZMIN_SETTINGS = { "site_title": "ClercNet-Admin", # Title on the login screen (19 chars max) (defaults to current_admin_site.site_header if absent or None) - "site_header": "ClercNet v3.0", + "site_header": f"ClercNet {VERSION}", # Title on the brand (19 chars max) (defaults to current_admin_site.site_header if absent or None) - "site_brand": "ClercNet v3", + "site_brand": f"ClercNet {VERSION}", # Logo to use for your site, must be present in static files, used for brand on top left "site_logo": "img/logo_clerc_200.png", diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..70cdc08 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +v3.1.1 \ No newline at end of file