From 8dea738893197a624fc8cbfc6a9586e07e62ae73 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 23 Aug 2022 08:37:00 +0100 Subject: [PATCH] Redirect API root to swagger docs --- website/api/urls.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/api/urls.py b/website/api/urls.py index 7070373..ce52ec9 100644 --- a/website/api/urls.py +++ b/website/api/urls.py @@ -1,4 +1,5 @@ from django.urls import include, path, re_path +from django.views.generic import RedirectView from drf_yasg import openapi from drf_yasg.views import get_schema_view from rest_framework import permissions @@ -37,4 +38,5 @@ urlpatterns = [ re_path( r"^redoc/$", schema_view.with_ui("redoc", cache_timeout=0), name="schema-redoc" ), + path("", RedirectView.as_view(pattern_name="api:schema-swagger-ui")), ] + api_urlpatterns