-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurls.py
18 lines (16 loc) · 796 Bytes
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from quora_clone import settings
from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView
from django.views.generic import TemplateView
urlpatterns = [
path('', TemplateView.as_view(template_name='index.html')),
path('admin/', admin.site.urls),
path("api/v1/", include(('api.urls', 'api'), namespace='api')),
path('api-schema/', SpectacularAPIView.as_view(), name='schema'),
# Optional UI:
path('api-docs/', SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)