diff --git a/website/api/urls.py b/website/api/urls.py index cb5d2c7..20644a8 100644 --- a/website/api/urls.py +++ b/website/api/urls.py @@ -39,5 +39,5 @@ urlpatterns = [ schema_view.with_ui("swagger", cache_timeout=60 * 60), name="schema-swagger-ui", ), - path("", RedirectView.as_view(pattern_name="api:schema-swagger-ui")), + path("", RedirectView.as_view(pattern_name="api:schema-swagger-ui"), name="index"), ] + api_urlpatterns diff --git a/website/common/templates/robots.txt b/website/common/templates/robots.txt index 0f9c173..00a94bf 100644 --- a/website/common/templates/robots.txt +++ b/website/common/templates/robots.txt @@ -7,4 +7,5 @@ Disallow: / {% endif %} Disallow: {% url "wagtailadmin_home" %} +Disallow: {% url "api:index" %} Sitemap: {{ sitemap }} diff --git a/website/urls.py b/website/urls.py index c2393b6..b9a1278 100644 --- a/website/urls.py +++ b/website/urls.py @@ -45,7 +45,7 @@ urlpatterns = [ path("feed/", AllPagesFeed(), name="feed"), path(".health/", include("health_check.urls")), path("", include("website.legacy.urls")), - path("api/", include("website.api.urls")), + path("api/", include("website.api.urls", namespace="api")), path("", include(favicon_urls)), # Some say it's a bad idea to serve media with Django - I don't care re_path(