From 6ad777c86fa0c8e8eae1a5c79cc1070f92c59bb5 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Tue, 19 Mar 2024 15:06:49 +0000 Subject: [PATCH] dev_urls: Make requests to /docs redirect to the index. This makes it easier to browse to the docs in development mode, and more closely matches ReadTheDocs production. --- zerver/lib/test_helpers.py | 1 + zproject/dev_urls.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/zerver/lib/test_helpers.py b/zerver/lib/test_helpers.py index e4903fa11f..3c867570de 100644 --- a/zerver/lib/test_helpers.py +++ b/zerver/lib/test_helpers.py @@ -505,6 +505,7 @@ def write_instrumentation_reports(full_suite: bool, include_webhooks: bool) -> N "config-error/(?P[^/]+)", "confirmation_key/", "node-coverage/(?P.+)", + "docs/", "docs/(?P.+)", "casper/(?P.+)", "static/(?P.+)", diff --git a/zproject/dev_urls.py b/zproject/dev_urls.py index 7e5c4abad4..53ac877d0b 100644 --- a/zproject/dev_urls.py +++ b/zproject/dev_urls.py @@ -7,7 +7,7 @@ from django.contrib.staticfiles.views import serve as staticfiles_serve from django.http.request import HttpRequest from django.http.response import FileResponse from django.urls import path -from django.views.generic import TemplateView +from django.views.generic import RedirectView, TemplateView from django.views.static import serve from zerver.views.auth import login_page @@ -52,6 +52,7 @@ urls = [ "show_indexes": True, }, ), + path("docs/", RedirectView.as_view(url="/docs/index.html")), path( "docs/", serve,