from django.shortcuts import render

# Create your views here.

@@ -33,31 +33,1012 @@
 der%0A
-%0A# Create your views here.
+from django.contrib.auth import login, logout%0Afrom django.contrib.auth.models import User%0Afrom rest_framework import viewsets%0Afrom rest_framework.permissions import AllowAny%0Afrom rest_framework.response import Response%0Afrom rest_framework.views import APIView%0A%0A# Create your views here.%0A%0Afrom . import serializers, permissions, authenticators, models%0A%0Aclass UserView(viewsets.ModelViewSet):%0A    serializer_class = serializers.UserSerializer%0A    model = User%0A%0A    def get_permissions(self):%0A        # allow non-authenticated user to create%0A        return (AllowAny() if self.request.method == 'POST'%0A                else permissions.IsStaffOrTargetUser()),%0A%0Aclass AuthView(APIView):%0A    authentication_classes = (authenticators.QuietBasicAuthentication,)%0A%0A    def post(self, request, *args, **kwargs):%0A        login(request, request.user)%0A        return Response(serializers.UserSerializer(request.user).data)%0A%0A    def delete(self, request, *args, **kwargs):%0A        logout(request)%0A        return Response()
 %0A

Update the models for Auth and User.