Created
April 4, 2019 14:16
-
-
Save aaronlelevier/7109aa16e6e99e98c1e17f2914a4fa3e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# urls.py | |
url(r'^api/logout/$', apiauth_views.LogoutView.as_view()), | |
# views.py | |
from django.contrib import auth | |
from rest_framework.views import APIView | |
class LogoutView(APIView): | |
def post(self, request, *args, **kwargs): | |
auth.logout(request) | |
return Response(status=status.HTTP_204_NO_CONTENT) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment