-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
urls.py
29 lines (22 loc) · 1.19 KB
/
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
"""This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.
"""
from django.urls import path, include
from . import api
app_name = 'data_import'
_api_urlpatterns = [
path('file-upload/<int:pk>', api.FileUploadAPI.as_view(), name='file-upload-detail')
]
_api_projects_urlpatterns = [
# import api
path('<int:pk>/tasks/bulk/', api.TasksBulkCreateAPI.as_view(), name='project-tasks-bulk-upload'),
path('<int:pk>/import', api.ImportAPI.as_view(), name='project-import'),
path('<int:pk>/reimport', api.ReImportAPI.as_view(), name='project-reimport'),
path('<int:pk>/file-uploads', api.FileUploadListAPI.as_view(), name='project-file-upload-list'),
path('<int:pk>/', api.FileUploadListAPI.as_view(), name='project-file-upload-list'),
]
urlpatterns = [
path('api/import/', include((_api_urlpatterns, app_name), namespace='api')),
path('api/projects/', include((_api_projects_urlpatterns, app_name), namespace='api-projects')),
# special endpoints for serving imported files
path('data/upload/<str:filename>', api.UploadedFileResponse.as_view(), name='data-upload'),
]