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.
This commit is contained in:
@@ -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": [
|
||||
|
||||
Reference in New Issue
Block a user