mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2025-06-29 00:35:45 +08:00
Added Djoser
This commit is contained in:
parent
83682bead6
commit
ab7fb228e3
13 changed files with 340 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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'))
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue