from django.conf.urls import url, include from app.api.presets import PresetViewSet from app.plugins.views import api_view_handler from .projects import ProjectViewSet from .tasks import TaskViewSet, TaskDownloads, TaskAssets, TaskAssetsImport from .imageuploads import Thumbnail, ImageDownload from .processingnodes import ProcessingNodeViewSet, ProcessingNodeOptionsView from .admin import UserViewSet, GroupViewSet from rest_framework_nested import routers from rest_framework_jwt.views import obtain_jwt_token from .tiler import TileJson, Bounds, Metadata, Tiles, Export from .potree import Scene, CameraView from .workers import CheckTask, GetTaskResult router = routers.DefaultRouter() router.register(r'projects', ProjectViewSet) router.register(r'processingnodes', ProcessingNodeViewSet) router.register(r'presets', PresetViewSet, base_name='presets') tasks_router = routers.NestedSimpleRouter(router, r'projects', lookup='project') tasks_router.register(r'tasks', TaskViewSet, base_name='projects-tasks') admin_router = routers.DefaultRouter() admin_router.register(r'admin/users', UserViewSet, basename='user') admin_router.register(r'admin/groups', GroupViewSet, basename='group') urlpatterns = [ url(r'processingnodes/options/$', ProcessingNodeOptionsView.as_view()), url(r'^', include(router.urls)), url(r'^', include(tasks_router.urls)), url(r'^', include(admin_router.urls)), url(r'projects/(?P[^/.]+)/tasks/(?P[^/.]+)/(?Porthophoto|dsm|dtm)/tiles\.json$', TileJson.as_view()), url(r'projects/(?P[^/.]+)/tasks/(?P[^/.]+)/(?Porthophoto|dsm|dtm)/bounds$', Bounds.as_view()), url(r'projects/(?P[^/.]+)/tasks/(?P[^/.]+)/(?Porthophoto|dsm|dtm)/metadata$', Metadata.as_view()), url(r'projects/(?P[^/.]+)/tasks/(?P[^/.]+)/(?Porthophoto|dsm|dtm)/tiles/(?P[\d]+)/(?P[\d]+)/(?P[\d]+)\.png$', Tiles.as_view()), url(r'projects/(?P[^/.]+)/tasks/(?P[^/.]+)/(?Porthophoto|dsm|dtm)/tiles/(?P[\d]+)/(?P[\d]+)/(?P[\d]+)@(?P[\d]+)x\.png$', Tiles.as_view()), url(r'projects/(?P[^/.]+)/tasks/(?P[^/.]+)/orthophoto/export$', Export.as_view()), url(r'projects/(?P[^/.]+)/tasks/(?P[^/.]+)/download/(?P.+)$', TaskDownloads.as_view()), url(r'projects/(?P[^/.]+)/tasks/(?P[^/.]+)/assets/(?P.+)$', TaskAssets.as_view()), url(r'projects/(?P[^/.]+)/tasks/import$', TaskAssetsImport.as_view()), url(r'projects/(?P[^/.]+)/tasks/(?P[^/.]+)/images/thumbnail/(?P.+)$', Thumbnail.as_view()), url(r'projects/(?P[^/.]+)/tasks/(?P[^/.]+)/images/download/(?P.+)$', ImageDownload.as_view()), url(r'projects/(?P[^/.]+)/tasks/(?P[^/.]+)/3d/scene$', Scene.as_view()), url(r'projects/(?P[^/.]+)/tasks/(?P[^/.]+)/3d/cameraview$', CameraView.as_view()), url(r'workers/check/(?P.+)', CheckTask.as_view()), url(r'workers/get/(?P.+)', GetTaskResult.as_view()), url(r'^auth/', include('rest_framework.urls')), url(r'^token-auth/', obtain_jwt_token), url(r'^plugins/(?P[^/.]+)/(.*)$', api_view_handler) ]