본문 바로가기
Django/Django Rest Framework

11. Django DRF 로그아웃 구현

by S.T.Lee 2022. 6. 19.
from django.contrib.auth import logout

class UserApiView(APIView):
    def delete(self, request):
        logout(request)
        return Response({'message':'로그아웃 성공!'})

간단!

<출처 Django 공식문서 - https://docs.djangoproject.com/en/4.0/topics/auth/default/>

'Django > Django Rest Framework' 카테고리의 다른 글

13. Django DRF 역참조  (0) 2022.06.19
12. Django DRF 외래 키  (0) 2022.06.19
10. Django DRF 로그인 구현  (0) 2022.06.19
9. Django DRF custom user 생성  (0) 2022.06.19
8. Django DRF rest api에 대한 이해  (0) 2022.06.18