21 lines
646 B
Python
21 lines
646 B
Python
from django.conf.urls import url, include
|
|
from rest_framework import routers
|
|
from . import views
|
|
|
|
router = routers.DefaultRouter()
|
|
router.register(r'rooms', views.RoomViewSet)
|
|
router.register(r'equipments', views.EquipmentViewSet)
|
|
|
|
# Wire up our API using automatic URL routing.
|
|
# Additionally, we include login URLs for the browsable API.
|
|
urlpatterns = [
|
|
url(r'^api/', include(router.urls)),
|
|
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
|
|
url(r'^api/me/', views.MeView.as_view())
|
|
]
|
|
|
|
from rest_framework.authtoken import views
|
|
|
|
urlpatterns += [
|
|
url(r'^api-token-auth/', views.obtain_auth_token)
|
|
]
|