feat: add DRF token authentication support
All checks were successful
CVE Scan & Docker Build / security-scan (push) Successful in 50s
CVE Scan & Docker Build / build-and-push (push) Successful in 2m33s

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.
This commit is contained in:
2026-05-12 06:08:18 -04:00
parent d57294db67
commit 4f77ed39b9

View File

@@ -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": [