-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for namespaces in APIRoot.
- Loading branch information
Rocky Meza
committed
Dec 27, 2014
1 parent
e6041f9
commit b36a4fd
Showing
4 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from django.conf.urls import url, include | ||
|
||
from rest_framework import viewsets, routers | ||
|
||
from .models import APIRootTestModel | ||
|
||
|
||
class APIRootTestViewSet(viewsets.ModelViewSet): | ||
model = APIRootTestModel | ||
|
||
|
||
router = routers.DefaultRouter() | ||
router.register(r'test-model', APIRootTestViewSet) | ||
|
||
|
||
urlpatterns = [ | ||
url('^api/', include(router.urls)), | ||
url('^namespaced-api/', include(router.urls, namespace='api-namespace')), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters