Added Djoser

This commit is contained in:
Keannu Christian Bernasol 2023-06-26 19:10:04 +08:00
parent 83682bead6
commit ab7fb228e3
13 changed files with 340 additions and 3 deletions

View file

@ -42,6 +42,8 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'djoser',
'rest_framework.authtoken',
]
MIDDLEWARE = [
@ -72,6 +74,18 @@ TEMPLATES = [
},
]
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.TokenAuthentication',
)
}
DJOSER = {
'SEND_ACTIVATION_EMAIL': True,
'SEND_CONFIRMATION_EMAIL': True,
'ACTIVATION_URL': 'activation/{uid}/{token}',
}
WSGI_APPLICATION = 'config.wsgi.application'
@ -85,6 +99,10 @@ DATABASES = {
}
}
EMAIL_HOST = str(os.getenv('EMAIL_HOST'))
EMAIL_HOST_USER = str(os.getenv('EMAIL_HOST_USER'))
EMAIL_HOST_PASSWORD = str(os.getenv('EMAIL_HOST_PASSWORD'))
EMAIL_PORT = str(os.getenv('EMAIL_PORT'))
# Password validation
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators

View file

@ -15,8 +15,9 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('api/v1/', include('api.urls'))
]