From 4ad3bedb18744150ab943fdd6a870c9d6a7a772d Mon Sep 17 00:00:00 2001 From: keannu125 Date: Sat, 25 Feb 2023 17:57:38 +0800 Subject: [PATCH] Added djoser --- project/accounts/__init__.py | 0 project/accounts/admin.py | 3 +++ project/accounts/apps.py | 6 ++++++ project/accounts/migrations/__init__.py | 0 project/accounts/models.py | 3 +++ project/accounts/tests.py | 3 +++ project/accounts/urls.py | 5 +++++ project/accounts/views.py | 3 +++ project/api/urls.py | 3 ++- project/config/settings.py | 3 ++- project/config/urls.py | 2 +- project/db.sqlite3 | Bin 151552 -> 151552 bytes 12 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 project/accounts/__init__.py create mode 100644 project/accounts/admin.py create mode 100644 project/accounts/apps.py create mode 100644 project/accounts/migrations/__init__.py create mode 100644 project/accounts/models.py create mode 100644 project/accounts/tests.py create mode 100644 project/accounts/urls.py create mode 100644 project/accounts/views.py diff --git a/project/accounts/__init__.py b/project/accounts/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/project/accounts/admin.py b/project/accounts/admin.py new file mode 100644 index 0000000..ea5d68b --- /dev/null +++ b/project/accounts/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/project/accounts/apps.py b/project/accounts/apps.py new file mode 100644 index 0000000..d69d316 --- /dev/null +++ b/project/accounts/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class AccountsConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'accounts' diff --git a/project/accounts/migrations/__init__.py b/project/accounts/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/project/accounts/models.py b/project/accounts/models.py new file mode 100644 index 0000000..fd18c6e --- /dev/null +++ b/project/accounts/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/project/accounts/tests.py b/project/accounts/tests.py new file mode 100644 index 0000000..de8bdc0 --- /dev/null +++ b/project/accounts/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/project/accounts/urls.py b/project/accounts/urls.py new file mode 100644 index 0000000..06cf4c6 --- /dev/null +++ b/project/accounts/urls.py @@ -0,0 +1,5 @@ +from django.urls import path, include + +urlpatterns = [ + path('accounts/', include('djoser.urls')), +] diff --git a/project/accounts/views.py b/project/accounts/views.py new file mode 100644 index 0000000..c60c790 --- /dev/null +++ b/project/accounts/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/project/api/urls.py b/project/api/urls.py index d2e4445..d608648 100644 --- a/project/api/urls.py +++ b/project/api/urls.py @@ -2,5 +2,6 @@ from django.contrib import admin from django.urls import path, include urlpatterns = [ - path('api/v1/', include('notes.urls')) + path('', include('notes.urls')), + path('accounts/', include('djoser.urls')), ] diff --git a/project/config/settings.py b/project/config/settings.py index 89b8d9f..2e6be28 100644 --- a/project/config/settings.py +++ b/project/config/settings.py @@ -39,7 +39,8 @@ INSTALLED_APPS = [ 'django.contrib.staticfiles', 'rest_framework', 'notes.apps.NotesConfig', - 'corsheaders' + 'corsheaders', + 'djoser' ] MIDDLEWARE = [ diff --git a/project/config/urls.py b/project/config/urls.py index 87dbb51..e84cc21 100644 --- a/project/config/urls.py +++ b/project/config/urls.py @@ -18,5 +18,5 @@ from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), - path('', include('api.urls')) + path('api/v1/', include('api.urls')) ] diff --git a/project/db.sqlite3 b/project/db.sqlite3 index d7142be08d032fbd2abab8b2879eceac8d534238..677836587f1c8d8601cac6a9602585823dfad80c 100644 GIT binary patch delta 671 zcmaiy%Wm3W5QXiMmN*izy2_##r7cnymBIdfM@oeufC(`+;TF6h#^4KJFc<>P29mx& z^8}6h1Zk1l$Eeg*rDjoO+Xtw+tCegbRaHkvvznvPd}o#y$npYt`v{JoKTgB(4@a-# zFtU0V@8Az$RDn=s^=vzfE>1Bx0-f#%$X4VPf(Q|})oUA|=~)_}nJCHQK}F{s%5o~Z z-CD)bwN&kZFImC~9yM@DqbiJIlCqNlcwMZ=DZ4i=#Pc*c0zB83y|TWao7&=|ktQae|MLfC4nV0YMOq{(=I9R}YVV zqR4t^3%Rj>T&``e!<*lsKpVk%Up5zK&*A&ho3cP#mdE;>H83fH_2-mn9~*O%AIw~P z+?x)2vCiJS)|EVYW(%bQ1ItdznYL)=r=;N()tqKlyY*6ERQpZQXt~01n;a;z(U|5L zV&4YGlJ5GYso+)Iwy*S5hGNSC=JEbQqltRGQ6UK!o;lRU>71%`R0h|ZvILm4ne}TgO;)RPRX4w@xAOU0s3b-ZcQfEvz@J@yx`fw~ x!Dn1S=v9FAD;j$dl92ylyA9(SLazhQH}vU~kbwMq%ljYrxf1>yPTu>C{sFn$$b