diff --git a/IMMEX/views.py b/IMMEX/views.py index e2d9fa9..4544131 100644 --- a/IMMEX/views.py +++ b/IMMEX/views.py @@ -17,6 +17,9 @@ from .forms import ClienteForm_IMMEX from .serializers import ClientesA24Serailizer,SerialiazerA24 from rest_framework.authentication import TokenAuthentication from rest_framework.views import APIView +from rest_framework.authtoken.models import Token +from rest_framework import authentication + from rest_framework.response import Response from rest_framework import status from rest_framework.permissions import IsAuthenticated @@ -77,12 +80,9 @@ class ClientesIMMEX_CreateView(CreateView): return response """---------API VIEWS---------""" -from rest_framework.authtoken.models import Token -from rest_framework import authentication, permissions, views - -class LoginIMMEX(views.APIView): - authentication_classes = [authentication.TokenAuthentication] - permission_classes = [permissions.IsAuthenticated, permissions.HasAuthorizationHeader] +class LoginIMMEX(APIView): + authentication_classes = [TokenAuthentication] + permission_classes = [IsAuthenticated, HasAuthorizationHeader] def post(self, request): try: