def logout(request): #get authentication mgr mgr=AuthMgr(request) #log user out mgr.logout() #return authentication return HttpResponse( AIResponse().serialize() )
def login(request,uname,pwd): #get authentication mgr mgr=AuthMgr(request) #authenticate user auth=mgr.login(uname,pwd) if auth==False: return HttpResponse( AIResponse(error=AIError(AIError.VALIDATION)).serialize() ) #return authentication return HttpResponse( AIResponse(data=auth).serialize() )