from django.conf.urls import include, url
from django.contrib import admin
from rest_framework import routers

from planner.views import SchoolViewSet

router = routers.DefaultRouter()
router.register('schools', SchoolViewSet)

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^api/', include(router.urls)),
    url(r'^api-auth/', include('rest_framework.urls')),
]

from django.conf.urls import include, url
from django.contrib import admin
from rest_framework import routers

from planner.views import SchoolViewSet

router = routers.DefaultRouter()
router.register('schools', SchoolViewSet)

urlpatterns = [
    url(r'^', include(router.urls)),
    url(r'^admin/', admin.site.urls),
    url(r'^api-auth/', include('rest_framework.urls')),
]

Move the API to the root.
Move the API to the root.

  from django.conf.urls import include, url
  from django.contrib import admin
  from rest_framework import routers
  
  from planner.views import SchoolViewSet
  
  router = routers.DefaultRouter()
  router.register('schools', SchoolViewSet)
  
  urlpatterns = [
+     url(r'^', include(router.urls)),
      url(r'^admin/', admin.site.urls),
-     url(r'^api/', include(router.urls)),
      url(r'^api-auth/', include('rest_framework.urls')),
  ]
  
Move the API to the root.
## Code Before:
from django.conf.urls import include, url
from django.contrib import admin
from rest_framework import routers

from planner.views import SchoolViewSet

router = routers.DefaultRouter()
router.register('schools', SchoolViewSet)

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^api/', include(router.urls)),
    url(r'^api-auth/', include('rest_framework.urls')),
]

## Instruction:
Move the API to the root.
## Code After:
from django.conf.urls import include, url
from django.contrib import admin
from rest_framework import routers

from planner.views import SchoolViewSet

router = routers.DefaultRouter()
router.register('schools', SchoolViewSet)

urlpatterns = [
    url(r'^', include(router.urls)),
    url(r'^admin/', admin.site.urls),
    url(r'^api-auth/', include('rest_framework.urls')),
]
