From b0815e00c7b3dd807aebc28fff249d42b96d4eba Mon Sep 17 00:00:00 2001 From: icovada Date: Fri, 2 Jan 2026 12:54:31 +0000 Subject: [PATCH] Add token authentication to the API --- app/WYGIWYH/settings.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/WYGIWYH/settings.py b/app/WYGIWYH/settings.py index fe99dca..c4a89eb 100644 --- a/app/WYGIWYH/settings.py +++ b/app/WYGIWYH/settings.py @@ -70,6 +70,7 @@ INSTALLED_APPS = [ "apps.api.apps.ApiConfig", "cachalot", "rest_framework", + "rest_framework.authtoken", "drf_spectacular", "django_cotton", "apps.rules.apps.RulesConfig", @@ -433,6 +434,11 @@ REST_FRAMEWORK = { "apps.api.permissions.NotInDemoMode", "rest_framework.permissions.DjangoModelPermissions", ], + 'DEFAULT_AUTHENTICATION_CLASSES': [ + 'rest_framework.authentication.BasicAuthentication', + 'rest_framework.authentication.SessionAuthentication', + 'rest_framework.authentication.TokenAuthentication', + ], "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.PageNumberPagination", "PAGE_SIZE": 10, "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",