File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44from rest_framework .decorators import api_view
55from rest_framework import viewsets
66from rest_framework import generics
7+ from rest_framework import permissions
78from account .models import Transaction , Customer
89from account .serializers import TransactionSerializer , CustomerSerializer
910
@@ -28,6 +29,7 @@ def transaction_list_view(request):
2829class TransactionView (generics .ListCreateAPIView ):
2930 queryset = Transaction .objects .all ()
3031 serializer_class = TransactionSerializer
32+ permission_classes = [permissions .IsAuthenticatedOrReadOnly ]
3133
3234
3335class CustomerView (generics .ListCreateAPIView ):
Original file line number Diff line number Diff line change 120120# https://docs.djangoproject.com/en/3.1/howto/static-files/
121121
122122STATIC_URL = '/static/'
123+
124+ REST_FRAMEWORK = {
125+ 'DEFAULT_PERMISSION_CLASSES' : (
126+ 'rest_framework.permissions.IsAuthenticated' ,
127+ ),
128+ }
You can’t perform that action at this time.
0 commit comments