feat: token based auth

This commit is contained in:
Tahinli 2024-06-30 17:36:29 +03:00
parent ef4ca9ab6a
commit 82add23844
7 changed files with 27 additions and 12 deletions

View file

@ -38,13 +38,14 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'rest_framework.authtoken',
'hello',
'user',
]
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.TokenAuthentication',
]
}