token authentication

This commit is contained in:
2023-02-22 12:38:33 +01:00
parent 9546d99d66
commit 5af19ed4c3
2 changed files with 14 additions and 2 deletions

View File

@@ -31,9 +31,20 @@ INSTALLED_APPS = [
'compra.apps.CompraConfig',
# Terceras partes
'rest_framework',
'rest_framework.authtoken',
'djoser'
]
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES':
('rest_framework.authentication.TokenAuthentication', ),
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticated',
]
}
# configure Djoser
DJOSER = {"USER_ID_FIELD": "email"}
AUTH_USER_MODEL = 'authentication.User'
MIDDLEWARE = [