<filename>positions/urls.py<gh_stars>1-10
from django.conf.urls import include, url
from django.contrib import admin

from rest_framework import routers
from positions.views import PositionsViewSet
from positions.views_generics import (PositionsEditView,
                                      PositionsListView,
                                      PositionsSearchView
                                      )

# this is DRF router for REST API viewsets
router = routers.DefaultRouter()

# register REST API endpoints with DRF router
router.register(r'positions', PositionsViewSet, base_name='position')

urlpatterns = [
    # default django admin interface
    url(r'^admin/', include(admin.site.urls)),
    # Generics views
    url(r'^api2/(?P<id>[a-z0-9]+)/$', PositionsEditView.as_view()),
    url(r'^api2/$', PositionsListView.as_view()),
    url(r'^api2/search', PositionsSearchView.as_view()),

    # REST API root view (generated by DRF router)
    url(r'^api/', include(router.urls, namespace='api')),
]

<filename>positions/urls.py<gh_stars>1-10
from django.conf.urls import include, url
from django.contrib import admin

from rest_framework import routers
from positions.views import PositionsViewSet
from positions.views_generics import (PositionsEditView,
                                      PositionsListView,
                                      PositionsSearchView
                                      )

# this is DRF router for REST API viewsets
router = routers.DefaultRouter()

# register REST API endpoints with DRF router
router.register(r'positions', PositionsViewSet, base_name='position')

urlpatterns = [
    # default django admin interface
    url(r'^admin/', include(admin.site.urls)),
    # Generics views
    url(r'^api2/(?P<id>[a-z0-9]+)/$', PositionsEditView.as_view()),
    url(r'^api2/$', PositionsListView.as_view()),
    url(r'^api2/search', PositionsSearchView.as_view()),

    # REST API root view (generated by DRF router)
    url(r'^api/', include(router.urls, namespace='api')),
]

# this is DRF router for REST API viewsets # register REST API endpoints with DRF router # default django admin interface # Generics views # REST API root view (generated by DRF router)