Merge pull request #485 from icovada/token_authentication

feat(api): add token authentication
This commit is contained in:
Herculino Trotta
2026-01-10 14:15:28 -03:00
committed by GitHub

View File

@@ -70,6 +70,7 @@ INSTALLED_APPS = [
"apps.api.apps.ApiConfig", "apps.api.apps.ApiConfig",
"cachalot", "cachalot",
"rest_framework", "rest_framework",
"rest_framework.authtoken",
"drf_spectacular", "drf_spectacular",
"django_cotton", "django_cotton",
"apps.rules.apps.RulesConfig", "apps.rules.apps.RulesConfig",
@@ -433,6 +434,11 @@ REST_FRAMEWORK = {
"apps.api.permissions.NotInDemoMode", "apps.api.permissions.NotInDemoMode",
"rest_framework.permissions.DjangoModelPermissions", "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", "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.PageNumberPagination",
"PAGE_SIZE": 10, "PAGE_SIZE": 10,
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",