Refactor rest_api app and the method end points are registered. All apps API URL endpoints are now registered under the 'rest_api' namespace.
This commit is contained in:
@@ -2,21 +2,21 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.conf.urls import include, patterns, url
|
||||
|
||||
from .views import APIBase, Version_0, APIAppView, BrowseableObtainAuthToken
|
||||
from .views import APIBase, APIVersionView, APIAppView, BrowseableObtainAuthToken
|
||||
|
||||
version_0_urlpatterns = patterns(
|
||||
version_1_urlpatterns = patterns(
|
||||
'',
|
||||
url(r'^$', Version_0.as_view(), name='api-version-0'),
|
||||
url(r'^$', APIVersionView.as_view(), name='api-version-1'),
|
||||
url(
|
||||
r'^(?P<app_name>\w+)/$', APIAppView.as_view(),
|
||||
name='api-version-0-app'
|
||||
name='api-version-1-app'
|
||||
),
|
||||
)
|
||||
|
||||
urlpatterns = patterns(
|
||||
'',
|
||||
url(r'^$', APIBase.as_view(), name='api-root'),
|
||||
url(r'^v0/', include(version_0_urlpatterns)),
|
||||
url(r'^v1/', include(version_1_urlpatterns)),
|
||||
)
|
||||
|
||||
api_urls = patterns(
|
||||
|
||||
Reference in New Issue
Block a user