[后端-前台]增加用户注销功能,这个并没有做成api,感觉这个做成api可能没什么必要...所以干脆写了地址重定向到首页了,测试通过account.tests.py

This commit is contained in:
esp
2015-08-27 22:26:00 +08:00
parent c64bd9d165
commit f8677f4966
3 changed files with 22 additions and 1 deletions

View File

@@ -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):
"""