Skip to content

Commit

Permalink
추가: logout api 생성
Browse files Browse the repository at this point in the history
- 토큰 블랙리스트 활용한 로그아웃 기능 추가
- simplejwt 내장된 블랙리스트 view 사용
  • Loading branch information
Sahayana committed Nov 10, 2023
1 parent f8a78f4 commit 62a47bd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
1 change: 1 addition & 0 deletions alaltalk/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"six",
"rest_framework",
"rest_framework_simplejwt",
"rest_framework_simplejwt.token_blacklist",
"django_extensions",
]

Expand Down
35 changes: 15 additions & 20 deletions alaltalk/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,28 @@
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from ninja import NinjaAPI

from alaltalk.views import landing_home
from apps.chat.apis.v1.chat_room_router import router as chat_room_router
from apps.search.apis.v1.like_cancel_router import router as like_cancel_router
from apps.search.apis.v1.like_router import router as like_router
from apps.search.apis.v1.search_router import router as search_router

# from ninja import NinjaAPI

# from apps.chat.apis.v1.chat_room_router import router as chat_room_router
# from apps.search.apis.v1.like_cancel_router import router as like_cancel_router
# from apps.search.apis.v1.like_router import router as like_router
# from apps.search.apis.v1.search_router import router as search_router

# from alaltalk import views

# api = NinjaAPI()
# api.add_router("/search/", search_router)
# api.add_router("/like/", like_router)
# api.add_router("/like_cancel/", like_cancel_router)
# api.add_router("/chat_room/", chat_room_router)
api = NinjaAPI()
api.add_router("/search/", search_router)
api.add_router("/like/", like_router)
api.add_router("/like_cancel/", like_cancel_router)
api.add_router("/chat_room/", chat_room_router)

urlpatterns = [
path("admin/", admin.site.urls),
path("", landing_home, name="landing_page"),
path("account/", include("apps.account.urls")),
path("friend/", include("apps.friend.urls"))
# path("accounts/", include("accounts.urls")),
# path("chat/", include("chat.urls")),
# path("api/", api.urls),
path("friend/", include("apps.friend.urls")),
path("chat/", include("chat.urls")),
path("api/", api.urls),
]

# if settings.DEBUG:
# urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

0 comments on commit 62a47bd

Please sign in to comment.