Redirect API root to swagger docs

This commit is contained in:
Jake Howard 2022-08-23 08:37:00 +01:00
parent fc141c9778
commit 8dea738893
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -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