From 1d33f1134e49fb14d662556d5de6232d0a5acb39 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Sat, 10 Apr 2021 13:45:26 +0300 Subject: Add redirect app to settings and add resources redirections config --- pydis_site/settings.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pydis_site/settings.py b/pydis_site/settings.py index d409bb21..bc7ff1f3 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -87,6 +87,7 @@ INSTALLED_APPS = [ 'pydis_site.apps.resources', 'pydis_site.apps.content', 'pydis_site.apps.events', + 'pydis_site.apps.redirect', 'django.contrib.admin', 'django.contrib.auth', @@ -290,3 +291,12 @@ EVENTS_PAGES_PATH = Path(BASE_DIR, "pydis_site", "templates", "events", "pages") # Path for content pages CONTENT_PAGES_PATH = Path(BASE_DIR, "pydis_site", "apps", "content", "resources") + +# Define redirections here so these can be used for URLs and tests. +# Format: "original-path/": ("route:name", "redirection_route_name", ("testing", "args")) +REDIRECTIONS = { + "pages/resources/": ("resources:index", "resources_index_redirect", ()), + "pages/resources//": ( + "resources:resources", "resources_resources_redirect", ("reading",) + ), +} -- cgit v1.2.3