diff --git a/netbox/netbox/urls.py b/netbox/netbox/urls.py index 9b1f81dad..bad9261da 100644 --- a/netbox/netbox/urls.py +++ b/netbox/netbox/urls.py @@ -1,3 +1,5 @@ +from rest_framework_swagger.views import get_swagger_view + from django.conf import settings from django.conf.urls import include, url from django.contrib import admin @@ -7,6 +9,7 @@ from users.views import login, logout handler500 = handle_500 +swagger_view = get_swagger_view(title='NetBox API') _patterns = [ @@ -31,7 +34,7 @@ _patterns = [ url(r'^api/ipam/', include('ipam.api.urls', namespace='ipam-api')), url(r'^api/secrets/', include('secrets.api.urls', namespace='secrets-api')), url(r'^api/tenancy/', include('tenancy.api.urls', namespace='tenancy-api')), - url(r'^api/docs/', include('rest_framework_swagger.urls')), + url(r'^api/docs/', swagger_view, name='api_docs'), url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), # Error testing diff --git a/netbox/templates/_base.html b/netbox/templates/_base.html index ba90f0106..4e5846e14 100644 --- a/netbox/templates/_base.html +++ b/netbox/templates/_base.html @@ -294,7 +294,7 @@