diff --git a/padelclub_backend/settings.py b/padelclub_backend/settings.py index 803c384..3656300 100644 --- a/padelclub_backend/settings.py +++ b/padelclub_backend/settings.py @@ -106,18 +106,6 @@ AUTH_PASSWORD_VALIDATORS = [ }, ] -REST_FRAMEWORK = { - # Use Django's standard `django.contrib.auth` permissions, - # or allow read-only access for unauthenticated users. - 'DEFAULT_AUTHENTICATION_CLASSES': [ - 'rest_framework.authentication.BasicAuthentication', - 'rest_framework.authentication.SessionAuthentication', - ],'DEFAULT_PERMISSION_CLASSES': [ - # 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly' - 'rest_framework.permissions.IsAdminUser', - ] -} - # Internationalization # https://docs.djangoproject.com/en/4.1/topics/i18n/ @@ -155,3 +143,4 @@ REST_FRAMEWORK = { } from .settings_local import * +from .settings_app import * diff --git a/padelclub_backend/settings_app.py b/padelclub_backend/settings_app.py new file mode 100644 index 0000000..b4c6880 --- /dev/null +++ b/padelclub_backend/settings_app.py @@ -0,0 +1,13 @@ + +# Rest Framework configuration +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_AUTHENTICATION_CLASSES': [ + 'rest_framework.authentication.BasicAuthentication', + 'rest_framework.authentication.TokenAuthentication', + ] +}