DRF_Template/backend/config/urls.py

18 lines
647 B
Python
Raw Normal View History

2024-01-06 12:13:39 +08:00
from django.contrib import admin
from django.urls import path, include
from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView
from config.settings import DEBUG
2024-01-06 12:13:39 +08:00
urlpatterns = [
path('admin/', admin.site.urls),
path('api/v1/', include('api.urls')),
path('schema/', SpectacularAPIView.as_view(), name='schema'),
path('swagger/',
SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'),
path('redoc/',
SpectacularRedocView.as_view(url_name='schema'), name='redoc'),
]
if DEBUG:
urlpatterns += [path('silk/', include('silk.urls', namespace='silk'))]