mirror of
https://github.com/lemeow125/DRF_Template.git
synced 2024-11-17 12:19:24 +08:00
17 lines
647 B
Python
17 lines
647 B
Python
from django.contrib import admin
|
|
from django.urls import path, include
|
|
from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView
|
|
from config.settings import DEBUG
|
|
|
|
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'))]
|