Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
urls.py 1.74 KiB
from django.urls import include, path
from django.contrib.auth import views as auth_views
from rest_framework.schemas import get_schema_view
from rest_framework.routers import DefaultRouter
from . import views

router = DefaultRouter()
router.register(r'workspecification', views.WorkSpecificationViewset, basename="workspecification")
router.register(r'processing_site', views.ATDBProcessingSiteView, basename='processingsite')
urlpatterns = [
    # Perhaps both accounts and login could be moved to the ldv-spec main urls file?
    # authentication
    path('accounts/', include('django.contrib.auth.urls')),

    # specialization of the above, with more control
    path('login/', auth_views.LoginView.as_view(template_name='registration/login.html')),

    # REST API
    path('api/v1/data/', views.DataProductView.as_view(), name='dataproduct'),
    path('api/v1/insert_dataproduct/', views.InsertMultiDataproductView.as_view(), name='dataproduct-insert'),
    path('api/v1/data-location/', views.DataLocationView.as_view(), name='datalocation'),
    path('api/v1/data/<int:pk>/', views.DataProductDetailsView.as_view(), name='dataproduct-detail-view-api'),

    path('api/v1/uws/', include('uws.urls')),
    path('api/v1/openapi/', get_schema_view(
        title="LDV Specification",
        description="API description",
        version="0.0.1"
    ), name='openapi-schema'),
    path('api/v1/', include(router.urls)),
    # GUI
    path('', views.index, name='index'),
    path('api/', views.api, name='api'),
    path('specification/', views.specification_view, name='specification'),
    path('specification/<int:pk>/', views.specification_view, name='specification-detail'),
    # Workaround for injecting the urls from the ModelViewSet, which requires a "Router"


]