Add urls for user app

This commit is contained in:
jhyns 2023-05-03 14:45:06 +09:00
parent 317bce8c49
commit f39f0c2c7e
2 changed files with 21 additions and 0 deletions

View File

@ -20,4 +20,5 @@ from django.urls import include, path
urlpatterns = [ urlpatterns = [
path("admin/", admin.site.urls), path("admin/", admin.site.urls),
path("", include("market.urls")), path("", include("market.urls")),
path("user/", include("user.urls")),
] ]

20
user/urls.py Normal file
View File

@ -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),
]