Add urls for user app
This commit is contained in:
parent
317bce8c49
commit
f39f0c2c7e
@ -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")),
|
||||
]
|
||||
|
20
user/urls.py
Normal file
20
user/urls.py
Normal 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),
|
||||
]
|
Loading…
Reference in New Issue
Block a user