Skip to content Skip to sidebar Skip to footer

Django Rest Framework: Routers.defaultrouter() Url With Custom Path

I want to define a path to access a certain api. What works so far (urls.py): router = routers.DefaultRouter() router.register(r'test', views.TestViewSet) urlpatterns = patterns(''

Solution 1:

Try with

urlpatterns = patterns('',
url(r'^api/', include(router.urls)),
url(r'^test/add/$',  TestNewViewSet.as_view(), name='whatever'),

)

Post a Comment for "Django Rest Framework: Routers.defaultrouter() Url With Custom Path"