add the need for authentication on most services

clubs
Laurent 2 years ago
parent 6ca0fcbbed
commit b96fbc4059
  1. 6
      padelclub_backend/settings_app.py
  2. 2
      tournaments/views.py

@ -3,9 +3,9 @@
REST_FRAMEWORK = {
# Use Django's standard `django.contrib.auth` permissions,
# or allow read-only access for unauthenticated users.
# 'DEFAULT_PERMISSION_CLASSES': [
# 'rest_framework.permissions.IsAuthenticated',
# ],
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticated',
],
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.BasicAuthentication',
'rest_framework.authentication.TokenAuthentication',

@ -20,6 +20,7 @@ from rest_framework.decorators import api_view
from rest_framework import status
from rest_framework.generics import UpdateAPIView
from rest_framework.exceptions import MethodNotAllowed
from rest_framework.permissions import IsAuthenticated
from django.template import loader
from datetime import date
from django.http import JsonResponse
@ -220,6 +221,7 @@ class UserViewSet(viewsets.ModelViewSet):
class ClubViewSet(viewsets.ModelViewSet):
queryset = Club.objects.all()
serializer_class = ClubSerializer
permission_classes = []
class TournamentViewSet(viewsets.ModelViewSet):
queryset = Tournament.objects.all()

Loading…
Cancel
Save