[后端-前台]增加用户注销功能,这个并没有做成api,感觉这个做成api可能没什么必要...所以干脆写了地址重定向到首页了,测试通过account.tests.py
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
# coding=utf-8
|
||||
from django import http
|
||||
from django.contrib import auth
|
||||
from django.shortcuts import render
|
||||
from django.db.models import Q
|
||||
@@ -35,6 +36,10 @@ class UserLoginAPIView(APIView):
|
||||
return serializer_invalid_response(serializer)
|
||||
|
||||
|
||||
def Logout(request):
|
||||
auth.logout(request)
|
||||
return http.HttpResponseRedirect("/")
|
||||
|
||||
class UserRegisterAPIView(APIView):
|
||||
def post(self, request):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user