Added user model

This commit is contained in:
Keannu Christian Bernasol 2023-11-09 19:48:13 +08:00
parent 6ec649b1c6
commit 1c56369044
15 changed files with 659 additions and 128 deletions

View file

@ -65,7 +65,8 @@ INSTALLED_APPS = [
'rest_framework',
'rest_framework_simplejwt',
'djoser',
'corsheaders'
'corsheaders',
'accounts'
]
MIDDLEWARE = [
@ -139,11 +140,21 @@ DATABASES = {
}
}
AUTH_USER_MODEL = 'accounts.CustomUser'
DJOSER = {
'SEND_ACTIVATION_EMAIL': True,
'SEND_CONFIRMATION_EMAIL': True,
'EMAIL': {
'activation': 'config.email.ActivationEmail'
},
'ACTIVATION_URL': 'activation/{uid}/{token}',
'USER_AUTHENTICATION_RULES': ['djoser.authentication.TokenAuthenticationRule'],
'SERIALIZERS': {
'user': 'accounts.serializers.CustomUserSerializer',
'current_user': 'accounts.serializers.CustomUserSerializer',
'user_create': 'accounts.serializers.UserRegistrationSerializer',
},
}
# Password validation