Skip to content

Commit

Permalink
test swagger ui
Browse files Browse the repository at this point in the history
  • Loading branch information
ytliuSVN committed Nov 10, 2024
1 parent 8fe5448 commit 0f628b5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,19 @@
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from drf_spectacular.views import (
SpectacularAPIView,
SpectacularSwaggerView,
)
from django.contrib import admin
from django.urls import path

urlpatterns = [
path('admin/', admin.site.urls),
path('api/schema/', SpectacularAPIView.as_view(), name='api-schema'),
path(
'api/docs/',
SpectacularSwaggerView.as_view(url_name='api-schema'),
name='api-docs',
)
]

0 comments on commit 0f628b5

Please sign in to comment.