mirror of
https://github.com/lemeow125/Django-NotesApp.git
synced 2024-11-16 22:19:24 +08:00
Added token auth
This commit is contained in:
parent
fa5bd13ca0
commit
41c77ae9ef
4 changed files with 10 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
from django.urls import path, include
|
||||
|
||||
urlpatterns = [
|
||||
path('accounts/', include('djoser.urls')),
|
||||
path('', include('djoser.urls')),
|
||||
path('', include('djoser.urls.authtoken')),
|
||||
]
|
||||
|
|
|
@ -3,5 +3,5 @@ from django.urls import path, include
|
|||
|
||||
urlpatterns = [
|
||||
path('', include('notes.urls')),
|
||||
path('accounts/', include('djoser.urls')),
|
||||
path('accounts/', include('accounts.urls')),
|
||||
]
|
||||
|
|
|
@ -38,6 +38,7 @@ INSTALLED_APPS = [
|
|||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'rest_framework',
|
||||
'rest_framework.authtoken',
|
||||
'notes.apps.NotesConfig',
|
||||
'corsheaders',
|
||||
'djoser'
|
||||
|
@ -132,6 +133,12 @@ CORS_ALLOWED_ORIGINS = [
|
|||
"http://localhost:8000",
|
||||
]
|
||||
|
||||
REST_FRAMEWORK = {
|
||||
'DEFAULT_AUTHENTICATION_CLASSES': (
|
||||
'rest_framework.authentication.TokenAuthentication',
|
||||
),
|
||||
}
|
||||
|
||||
DJOSER = {
|
||||
'SEND_ACTIVATION_EMAIL': True,
|
||||
'SEND_CONFIRMATION_EMAIL': True,
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue