-
Notifications
You must be signed in to change notification settings - Fork 0
/
urls.py
31 lines (25 loc) · 1010 Bytes
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from django.urls import path, include
from rest_framework import routers
from rest_framework.schemas import get_schema_view
from django.views.generic import TemplateView
from . import views
import diana.utils as utils
router = routers.DefaultRouter()
# Manual viewsets
router.register(r'api/object', views.ObjectViewSet, basename='object')
router.register(r'api/place', views.PlaceViewSet, basename='place')
urlpatterns = [
path('', include(router.urls)),
path('api/schema/', get_schema_view(
title="Iconographia",
description="Schema for the Iconographia API at the Centre for Digital Humanities",
version="1.0.0",
urlconf="diana.urls"
), name='openapi-schema'),
path('documentation/', TemplateView.as_view(
template_name='redoc-ui.html',
extra_context={'schema_url':'openapi-schema'}
), name='redoc-ui'),
# Automatically generated views
*utils.get_model_urls('iconographia', 'api', exclude=['object', 'place', 'collabels']),
]