title: Defining two api end points with same generic class view Django Rest Framework?
body: <p>I am new to Django. I was trying to use django generic views, class based. </p>
  
  <p>How do I implement following situation, I have two api end points login/ and logout/ and the same view class handles it ?</p>
  
  <pre><code># Login and logout
  class SignInActivity(generics.RetrieveUpdateAPIView):
  
      serializer_class = UserSerializer
      request = None
  
      def get_queryset(self):
          return User.objects.filter(Q(username=self.request.data["username"])
                                 &amp; Q(userpassword=self.request.data["userpassword"]))
  
      def update(self, request, *args,  **kwargs):
          self.request = request
          query_set = self.get_queryset()
  
          if bool(query_set):
              query_set.update_or_create(username=self.request.data["username"],
                                     userpassword=self.request.data["userpassword"],
                                     defaults={
                                          "lastlogin": timezone.now()
                                      })
              return Response(data={"message": "User logged in successfully.", "response_code": 222}, status=201)
          else:
              return Response(data={"message": "User not found.", "response_code": 444}, status=201)
  </code></pre>
  
  <p>And my urls.py is </p>
  
  <pre><code>path('login/', SignInActivity.as_view())
  </code></pre>
  
  <p>This implementation hadles login/ with this class, PUT method. Now can I use  same class with another  method to handle logout/  PUT method?</p>