diff --git a/project/accounts/urls.py b/project/accounts/urls.py index 06cf4c6..d27d046 100644 --- a/project/accounts/urls.py +++ b/project/accounts/urls.py @@ -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')), ] diff --git a/project/api/urls.py b/project/api/urls.py index d608648..845d143 100644 --- a/project/api/urls.py +++ b/project/api/urls.py @@ -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')), ] diff --git a/project/config/settings.py b/project/config/settings.py index 993734b..e99db89 100644 --- a/project/config/settings.py +++ b/project/config/settings.py @@ -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, diff --git a/project/db.sqlite3 b/project/db.sqlite3 index d86ab9c..b2a2ba9 100644 Binary files a/project/db.sqlite3 and b/project/db.sqlite3 differ