From 6243f87732874ba34a993c358884b40584fc151d Mon Sep 17 00:00:00 2001 From: Christian Moser Date: Tue, 30 Dec 2025 05:40:56 +0100 Subject: [PATCH] added TINYWIKI_HOME settings for settings the app-specific homepages of the wiki --- django_project/context_processors.py | 7 +++++++ django_project/settings.py | 2 ++ tinywiki/views/home.py | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 django_project/context_processors.py diff --git a/django_project/context_processors.py b/django_project/context_processors.py new file mode 100644 index 0000000..2d139d9 --- /dev/null +++ b/django_project/context_processors.py @@ -0,0 +1,7 @@ +from . import settings + + +def tinywiki(request): + return { + 'tinywiki_home': settings.TINYWIKI_HOME, + } diff --git a/django_project/settings.py b/django_project/settings.py index af52c4e..419a8e5 100644 --- a/django_project/settings.py +++ b/django_project/settings.py @@ -36,6 +36,8 @@ ENV = Env( EMAIL_BACKEND=(str, "console"), ) +TINYWIKI_HOME = "grow-home" + _env_file = Path(ENV.path("DOTENV")) if _env_file.is_file(): ENV.read_env(_env_file) diff --git a/tinywiki/views/home.py b/tinywiki/views/home.py index b72fd22..474f5cd 100644 --- a/tinywiki/views/home.py +++ b/tinywiki/views/home.py @@ -29,7 +29,7 @@ class HomeView(View): page = None if self.user_can_create_system_pages: if settings.USE_BOOTSTRAP: - create_tw_home = f"{_('create a new page with the slug tw-home')}" # noqa: E501 + create_tw_home = f"{_(f'create a new page with the slug {settings.TINYWIKI_HOME}')}" # noqa: E501 else: create_tw_home = f"{_('create a new page with the slug tw-home')}" # noqa: E501 else: