Default authentication on endpoints

Ik was er namelijk alweer eentje vergeten dus heh.
This commit is contained in:
2025-05-22 22:30:06 +02:00
parent ce06b16881
commit a54f8947bb
6 changed files with 5 additions and 30 deletions
-5
View File
@@ -1,15 +1,10 @@
from itertools import permutations
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAuthenticated
from playlist.models import Artist
from playlist.serializers import ArtistSerializer
class ArtistListView(APIView):
authentication_classes = [SessionAuthentication]
permission_classes = [IsAuthenticated]
def get(self, request):
artists = Artist.objects.all()
serializer = ArtistSerializer(artists, many=True, context={'request': request})