From b95f17a35820414afcc91e4a69745a9ba83199ab Mon Sep 17 00:00:00 2001 From: keannu125 Date: Tue, 28 Feb 2023 00:44:07 +0800 Subject: [PATCH] Fixed config not pointing to itself and added djoser --- ivy/api/urls.py | 1 + ivy/config/asgi.py | 2 +- ivy/config/settings.py | 7 ++++--- ivy/config/urls.py | 3 ++- ivy/config/wsgi.py | 2 +- ivy/manage.py | 2 +- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ivy/api/urls.py b/ivy/api/urls.py index 46b2d7f..63176f3 100644 --- a/ivy/api/urls.py +++ b/ivy/api/urls.py @@ -2,4 +2,5 @@ from django.contrib import admin from django.urls import path, include urlpatterns = [ + path('accounts/', include('djoser.urls')) ] diff --git a/ivy/config/asgi.py b/ivy/config/asgi.py index f00dab1..4b36abc 100644 --- a/ivy/config/asgi.py +++ b/ivy/config/asgi.py @@ -11,6 +11,6 @@ import os from django.core.asgi import get_asgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ivy.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings') application = get_asgi_application() diff --git a/ivy/config/settings.py b/ivy/config/settings.py index bbe8938..07c1513 100644 --- a/ivy/config/settings.py +++ b/ivy/config/settings.py @@ -37,7 +37,8 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - 'rest_framework' + 'rest_framework', + 'djoser' ] MIDDLEWARE = [ @@ -50,7 +51,7 @@ MIDDLEWARE = [ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] -ROOT_URLCONF = 'ivy.urls' +ROOT_URLCONF = 'config.urls' TEMPLATES = [ { @@ -68,7 +69,7 @@ TEMPLATES = [ }, ] -WSGI_APPLICATION = 'ivy.wsgi.application' +WSGI_APPLICATION = 'config.wsgi.application' # Database diff --git a/ivy/config/urls.py b/ivy/config/urls.py index 18d9a48..6460ca4 100644 --- a/ivy/config/urls.py +++ b/ivy/config/urls.py @@ -14,8 +14,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')) ] diff --git a/ivy/config/wsgi.py b/ivy/config/wsgi.py index 826709c..9751313 100644 --- a/ivy/config/wsgi.py +++ b/ivy/config/wsgi.py @@ -11,6 +11,6 @@ import os from django.core.wsgi import get_wsgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ivy.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings') application = get_wsgi_application() diff --git a/ivy/manage.py b/ivy/manage.py index 9feb432..192aaab 100644 --- a/ivy/manage.py +++ b/ivy/manage.py @@ -6,7 +6,7 @@ import sys def main(): """Run administrative tasks.""" - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ivy.settings') + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: