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