Beispiel #1
0
from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter

from apps.endpoints.views import EndpointViewSet
from apps.endpoints.views import MLAlgorithmViewSet
from apps.endpoints.views import MLAlgorithmStatusViewSet
from apps.endpoints.views import MLRequestViewSet
from apps.endpoints.views import PredictView

# app_name = 'endpoints'

router = DefaultRouter(trailing_slash=False)

router.register(r"endpoints", EndpointViewSet, basename="endpoints")
router.register(r"mlalgorithms", MLAlgorithmViewSet, basename="mlalgorithms")
router.register(r"mlalgorithmstatuses", MLAlgorithmStatusViewSet, basename="mlalgorithmstatuses")
router.register(r"mlrequests", MLRequestViewSet, basename="mlrequests")

urlpatterns = [
    url(r"^api/v1/", include(router.urls)),
    url(r"^api/v1/(?P<endpoint_name>.+)/predict$", PredictView.as_view(), name="predicts"),
]
from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter

from apps.endpoints.views import EndpointViewSet
from apps.endpoints.views import MLAlgorithmViewSet
from apps.endpoints.views import MLAlgorithmStatusViewSet
from apps.endpoints.views import MLRequestViewSet
from apps.endpoints.views import PredictView

router = DefaultRouter(trailing_slash=False)
router.register(r"endpoints", EndpointViewSet, basename="endpoints")
router.register(r"mlalgorithms", MLAlgorithmViewSet, basename="mlalgorithms")
router.register(r"mlalgorithmstatuses",
                MLAlgorithmStatusViewSet,
                basename="mlalgorithmstatuses")
router.register(r"mlrequests", MLRequestViewSet, basename="mlrequests")

urlpatterns = [
    url(r"^api/v1/", include(router.urls)),
    # add predict url
    url(r"^api/v1/(?P<endpoint_name>.+)/prediction$",
        PredictView.as_view(),
        name="Prediction")
]
Beispiel #3
0
# backend/server/apps/endpoints/urls.py file
from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter

from apps import users
from apps.endpoints.views import MLAlgorithmViewSet
from apps.endpoints.views import MLAlgorithmStatusViewSet
from apps.endpoints.views import PredictView
from apps.endpoints.views import AlgorithmComparisonViewSet
from rest_framework.authtoken.views import obtain_auth_token

router = DefaultRouter(trailing_slash=False)
router.register(r"algorithms", MLAlgorithmViewSet, basename="algorithms")
router.register(
    r"algorithm_statuses", MLAlgorithmStatusViewSet, basename="algorithm_statuses"
)
router.register(r"algorithm_comparisons", AlgorithmComparisonViewSet, basename="algorithm_comparisons")

urlpatterns = [
    url(r"^", include(router.urls)),
    url(
        r"^(?P<algorithm_name>.+)/predict$", PredictView.as_view(), name="predict"
    ),
    url(r"^users/", include('apps.users.urls')),
    url(r"^rest-auth/", include('rest_auth.urls')),
    url(r"^rest-auth/registration/", include('rest_auth.registration.urls'))
]