19 lines
763 B
Python
19 lines
763 B
Python
from django.conf.urls import url, include
|
|
from rest_framework.routers import DefaultRouter
|
|
from api.event.views import EventViewSet, PlaceViewSet, ActivityTagViewSet,\
|
|
ActivityTemplateViewSet
|
|
|
|
# Create a router and register our viewsets with it.
|
|
router = DefaultRouter()
|
|
router.register(r'event', EventViewSet)
|
|
router.register(r'place', PlaceViewSet)
|
|
router.register(r'tag', ActivityTagViewSet)
|
|
router.register(r'activitytemplate', ActivityTemplateViewSet)
|
|
|
|
# The API URLs are now determined automatically by the router.
|
|
# Additionally, we include the login URLs for the browsable API.
|
|
urlpatterns = [
|
|
url(r'^', include(router.urls)),
|
|
url(r'^api-auth/', include('rest_framework.urls',
|
|
namespace='rest_framework'))
|
|
]
|