I\'m working on a store site, where every user is going to be anonymous (well, until it\'s time to pay at least), and I\'m trying to use Django REST Framework to serve the p
If using APIView you can create a permission for the view, example below:
urls.py
url(r'^my-endpoint', views.MyEndpoint.as_view())
permissions.py
class PublicEndpoint(permissions.BasePermission):
def has_permission(self, request, view):
return True
views.py
from permissions import PublicEndpoint
class MyEndpoint(APIView):
permission_classes = (PublicEndpoint,)
def get(self, request, format=None):
return Response({'Info':'Public Endpoint'})