From 4f77ed39b980262219c9adfd86eff6e0699ad54a Mon Sep 17 00:00:00 2001 From: Robert Helewka Date: Tue, 12 May 2026 06:08:18 -0400 Subject: [PATCH] feat: add DRF token authentication support Add `rest_framework.authtoken` to installed apps and configure `TokenAuthentication` as an authentication class in the REST framework settings, enabling token-based API authentication alongside existing session and basic authentication methods. --- mnemosyne/mnemosyne/settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mnemosyne/mnemosyne/settings.py b/mnemosyne/mnemosyne/settings.py index ce8eebc..7e26af8 100644 --- a/mnemosyne/mnemosyne/settings.py +++ b/mnemosyne/mnemosyne/settings.py @@ -50,6 +50,7 @@ INSTALLED_APPS = [ "django.contrib.humanize", # Third-party "rest_framework", + "rest_framework.authtoken", "storages", "django_neomodel", "django_prometheus", @@ -235,6 +236,7 @@ EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" REST_FRAMEWORK = { "DEFAULT_AUTHENTICATION_CLASSES": [ "rest_framework.authentication.SessionAuthentication", + "rest_framework.authentication.TokenAuthentication", "rest_framework.authentication.BasicAuthentication", ], "DEFAULT_PERMISSION_CLASSES": [