diff options
author | 2021-04-10 13:45:26 +0300 | |
---|---|---|
committer | 2021-05-03 20:19:50 +0300 | |
commit | 1d33f1134e49fb14d662556d5de6232d0a5acb39 (patch) | |
tree | 4984713696138daa2d81397eb7d2218e6b10e8a6 | |
parent | Create basic redirect app (diff) |
Add redirect app to settings and add resources redirections config
-rw-r--r-- | pydis_site/settings.py | 10 |
1 files changed, 10 insertions, 0 deletions
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/<str:category>/": ( + "resources:resources", "resources_resources_redirect", ("reading",) + ), +} |