2017-08-13 13:44:48 +00:00
|
|
|
from django.conf.urls import url, include
|
|
|
|
from rest_framework import routers
|
|
|
|
|
2017-08-13 15:59:14 +00:00
|
|
|
from .views import BabyViewSet, FeedingViewSet, SleepViewSet, UserViewSet
|
2017-08-13 13:44:48 +00:00
|
|
|
|
|
|
|
# Routers provide an easy way of automatically determining the URL conf.
|
|
|
|
router = routers.DefaultRouter()
|
2017-08-13 14:48:16 +00:00
|
|
|
router.register(r'babies', BabyViewSet)
|
2017-08-13 15:59:14 +00:00
|
|
|
router.register(r'feedings', FeedingViewSet)
|
2017-08-13 14:48:16 +00:00
|
|
|
router.register(r'sleep', SleepViewSet)
|
2017-08-13 15:59:14 +00:00
|
|
|
router.register(r'users', UserViewSet)
|
2017-08-13 13:44:48 +00:00
|
|
|
|
|
|
|
# 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'))
|
|
|
|
]
|