You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

177 lines
4.5 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. from django.urls import include, path
  2. from rest_framework.authtoken.views import obtain_auth_token
  3. from . import views
  4. urlpatterns_project = [
  5. path(
  6. route='statistics',
  7. view=views.StatisticsAPI.as_view(),
  8. name='statistics'),
  9. path(
  10. route='labels',
  11. view=views.LabelList.as_view(),
  12. name='label_list'
  13. ),
  14. path(
  15. route='label-upload',
  16. view=views.LabelUploadAPI.as_view(),
  17. name='label_upload'
  18. ),
  19. path(
  20. route='labels/<int:label_id>',
  21. view=views.LabelDetail.as_view(),
  22. name='label_detail'
  23. ),
  24. path(
  25. route='docs',
  26. view=views.DocumentList.as_view(),
  27. name='doc_list'
  28. ),
  29. path(
  30. route='docs/<int:doc_id>',
  31. view=views.DocumentDetail.as_view(),
  32. name='doc_detail'
  33. ),
  34. path(
  35. route='docs/<int:doc_id>/approve-labels',
  36. view=views.ApproveLabelsAPI.as_view(),
  37. name='approve_labels'
  38. ),
  39. path(
  40. route='docs/<int:doc_id>/annotations',
  41. view=views.AnnotationList.as_view(),
  42. name='annotation_list'
  43. ),
  44. path(
  45. route='docs/<int:doc_id>/annotations/<int:annotation_id>',
  46. view=views.AnnotationDetail.as_view(),
  47. name='annotation_detail'
  48. ),
  49. path(
  50. route='docs/<int:doc_id>/comments',
  51. view=views.CommentListDoc.as_view(),
  52. name='comment_list_doc'
  53. ),
  54. path(
  55. route='comments',
  56. view=views.CommentListProject.as_view(),
  57. name='comment_list_project'
  58. ),
  59. path(
  60. route='docs/<int:doc_id>/comments/<int:comment_id>',
  61. view=views.CommentDetail.as_view(),
  62. name='comment_detail'
  63. ),
  64. path(
  65. route='docs/upload',
  66. view=views.TextUploadAPI.as_view(),
  67. name='doc_uploader'
  68. ),
  69. path(
  70. route='docs/download',
  71. view=views.TextDownloadAPI.as_view(),
  72. name='doc_downloader'
  73. ),
  74. path(
  75. route='roles',
  76. view=views.RoleMappingList.as_view(),
  77. name='rolemapping_list'
  78. ),
  79. path(
  80. route='roles/<int:rolemapping_id>',
  81. view=views.RoleMappingDetail.as_view(),
  82. name='rolemapping_detail'
  83. ),
  84. path(
  85. route='auto-labeling-templates',
  86. view=views.AutoLabelingTemplateListAPI.as_view(),
  87. name='auto_labeling_templates'
  88. ),
  89. path(
  90. route='auto-labeling-templates/<str:option_name>',
  91. view=views.AutoLabelingTemplateDetailAPI.as_view(),
  92. name='auto_labeling_template'
  93. ),
  94. path(
  95. route='auto-labeling-configs',
  96. view=views.AutoLabelingConfigList.as_view(),
  97. name='auto_labeling_configs'
  98. ),
  99. path(
  100. route='auto-labeling-configs/<int:config_id>',
  101. view=views.AutoLabelingConfigDetail.as_view(),
  102. name='auto_labeling_config'
  103. ),
  104. path(
  105. route='auto-labeling-config-testing',
  106. view=views.AutoLabelingConfigTest.as_view(),
  107. name='auto_labeling_config_test'
  108. ),
  109. path(
  110. route='docs/<int:doc_id>/auto-labeling',
  111. view=views.AutoLabelingAnnotation.as_view(),
  112. name='auto_labeling_annotation'
  113. ),
  114. path(
  115. route='auto-labeling-template-testing',
  116. view=views.AutoLabelingTemplateTest.as_view(),
  117. name='auto_labeling_template_test'
  118. ),
  119. path(
  120. route='auto-labeling-mapping-testing',
  121. view=views.AutoLabelingMappingTest.as_view(),
  122. name='auto_labeling_mapping_test'
  123. )
  124. ]
  125. urlpatterns = [
  126. path(
  127. route='health',
  128. view=views.Health.as_view(),
  129. name='health'
  130. ),
  131. path('auth/', include('dj_rest_auth.urls')),
  132. path(
  133. route='me',
  134. view=views.Me.as_view(),
  135. name='me'
  136. ),
  137. path(
  138. route='features',
  139. view=views.Features.as_view(),
  140. name='features'
  141. ),
  142. path(
  143. route='cloud-upload',
  144. view=views.CloudUploadAPI.as_view(),
  145. name='cloud_uploader'
  146. ),
  147. path(
  148. route='projects',
  149. view=views.ProjectList.as_view(),
  150. name='project_list'
  151. ),
  152. path(
  153. route='users',
  154. view=views.Users.as_view(),
  155. name='user_list'
  156. ),
  157. path(
  158. route='roles',
  159. view=views.Roles.as_view(),
  160. name='roles'
  161. ),
  162. path(
  163. route='auto-labeling-parameter-testing',
  164. view=views.AutoLabelingConfigParameterTest.as_view(),
  165. name='auto_labeling_parameter_testing'
  166. ),
  167. path(
  168. route='projects/<int:project_id>',
  169. view=views.ProjectDetail.as_view(),
  170. name='project_detail'
  171. ),
  172. path('projects/<int:project_id>/', include(urlpatterns_project))
  173. ]