from django.conf.urls import url
from django.contrib import admin

admin.autodiscover()

urlpatterns = [
    url(regex='^admin/', view=admin.site.urls),
]

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

from views import BondViewSet

admin.autodiscover()

router = routers.DefaultRouter()
router.register(r'bond', BondViewSet)

urlpatterns = patterns(
    '',
    url(regex='^', view=include(router.urls)),
    url(regex='^admin/', view=admin.site.urls),
)

Add djangorestframework DefaultRouter instance and registered BondViewSet.
Add djangorestframework DefaultRouter instance and registered BondViewSet.

- from django.conf.urls import url
+ from django.conf.urls import patterns, include, url
  from django.contrib import admin
+ from rest_framework import routers
+ 
+ from views import BondViewSet
  
  admin.autodiscover()
  
- urlpatterns = [
+ router = routers.DefaultRouter()
+ router.register(r'bond', BondViewSet)
+ 
+ urlpatterns = patterns(
+     '',
+     url(regex='^', view=include(router.urls)),
      url(regex='^admin/', view=admin.site.urls),
- ]
+ )
  
Add djangorestframework DefaultRouter instance and registered BondViewSet.
## Code Before:
from django.conf.urls import url
from django.contrib import admin

admin.autodiscover()

urlpatterns = [
    url(regex='^admin/', view=admin.site.urls),
]

## Instruction:
Add djangorestframework DefaultRouter instance and registered BondViewSet.
## Code After:
from django.conf.urls import patterns, include, url
from django.contrib import admin
from rest_framework import routers

from views import BondViewSet

admin.autodiscover()

router = routers.DefaultRouter()
router.register(r'bond', BondViewSet)

urlpatterns = patterns(
    '',
    url(regex='^', view=include(router.urls)),
    url(regex='^admin/', view=admin.site.urls),
)
