Esempio n. 1
0
from django.conf.urls import url, include
from rest_framework import routers
from movierater.api import views
from movierater.api.views import CustomObtainAuthToken

router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
router.register(r'movies', views.MovieViewSet)
router.register(r'ratings', views.RatingViewSet)

urlpatterns = [
    url(r'^', include(router.urls)),
    url(r'auth/', CustomObtainAuthToken.as_view())
]
Esempio n. 2
0
from django.conf.urls import url, include
from rest_framework import routers
from movierater.api import views
from movierater.api.views import CustomObtainAuthToken

router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
router.register(r'movies', views.MovieViewSet)
router.register(r'ratings', views.RatingViewSet)

urlpatterns = [
    url(r'^', include(router.urls)),
    url(r'^authenticate/', CustomObtainAuthToken.as_view()),
]
Esempio n. 3
0
from django.urls import path, include
from rest_framework import routers
from movierater.api import views
from movierater.api.views import CustomObtainAuthToken

router = routers.DefaultRouter()
router.register('users', views.UserViewSet)
router.register('movies', views.MovieViewSet)
router.register('rating', views.RatingViewSet)

# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
    path('', include(router.urls)),
    path('authenticate/', CustomObtainAuthToken.as_view()),
]