Get rids of the APIEndPoint and APIResource classes. Register API url using the 'has_rest_api' AppConfig variable.

Signed-off-by: Michael Price <loneviking72@gmail.com>
This commit is contained in:
Michael Price
2018-03-04 04:21:29 -04:00
committed by Roberto Rosario
parent 36d19ea284
commit e1956f8d80
26 changed files with 39 additions and 197 deletions

View File

@@ -1,21 +1,17 @@
from __future__ import unicode_literals
from django.conf.urls import url
from django.conf.urls import include, url
from .api_views import APIResourceTypeListView
from .views import APIBase, BrowseableObtainAuthToken
from .api_views import BrowseableObtainAuthToken
urlpatterns = []
api_urls = [
url(r'^$', APIBase.as_view(), name='api_root'),
url(
r'^resources/$', APIResourceTypeListView.as_view(),
name='resource-list'
),
url(
r'^auth/token/obtain/$', BrowseableObtainAuthToken.as_view(),
name='auth_token_obtain'
),
]
urlpatterns = [
url(r'^', include(api_urls)),
]