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-04-01 18:30:59 -04:00
committed by Roberto Rosario
parent 36d19ea284
commit e1956f8d80
26 changed files with 39 additions and 197 deletions
+5 -9
View File
@@ -1,16 +1,12 @@
from __future__ import unicode_literals
from rest_framework import generics
from .classes import APIResource
from .serializers import APIResourceSerializer
from rest_framework import generics, renderers
from rest_framework.authtoken.views import ObtainAuthToken
class APIResourceTypeListView(generics.ListAPIView):
class BrowseableObtainAuthToken(ObtainAuthToken):
"""
Returns a list of all the available API resources.
Obtain an API authentication token.
"""
serializer_class = APIResourceSerializer
def get_queryset(self):
return APIResource.all()
renderer_classes = (renderers.BrowsableAPIRenderer, renderers.JSONRenderer)