From f39f0c2c7ee5ad954b7ccded29671c4040e08f0b Mon Sep 17 00:00:00 2001 From: jhyns Date: Wed, 3 May 2023 14:45:06 +0900 Subject: [PATCH] Add urls for user app --- config/urls.py | 1 + user/urls.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 user/urls.py diff --git a/config/urls.py b/config/urls.py index 92decab..469665f 100644 --- a/config/urls.py +++ b/config/urls.py @@ -20,4 +20,5 @@ from django.urls import include, path urlpatterns = [ path("admin/", admin.site.urls), path("", include("market.urls")), + path("user/", include("user.urls")), ] diff --git a/user/urls.py b/user/urls.py new file mode 100644 index 0000000..5c74280 --- /dev/null +++ b/user/urls.py @@ -0,0 +1,20 @@ +from django.conf import settings +from django.urls import path + +from rest_framework import routers + +from .views import login_view, logout_view +from .viewsets import UserViewset + + +if settings.DEBUG: + router = routers.DefaultRouter() +else: + router = routers.SimpleRouter() + +router.register("users", UserViewset) + +urlpatterns = router.urls + [ + path("login/", login_view), + path("logout/", logout_view), +]