1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 01:48:21 +02:00

Token authentication

This commit is contained in:
Yohann D'ANELLO
2020-02-17 19:25:33 +01:00
parent f3f13c5153
commit 55977bcbe7
5 changed files with 31 additions and 2 deletions

View File

@ -52,6 +52,7 @@ INSTALLED_APPS = [
'django.contrib.staticfiles',
# API
'rest_framework',
'rest_framework.authtoken',
# Autocomplete
'dal',
'dal_select2',
@ -127,6 +128,9 @@ REST_FRAMEWORK = {
# or allow read-only access for unauthenticated users.
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
],
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.TokenAuthentication',
]
}