reupload LoginIMMEX

This commit is contained in:
rexcom28
2023-05-29 10:34:36 -06:00
parent 1617228340
commit 358bb24f0e

View File

@@ -17,6 +17,9 @@ from .forms import ClienteForm_IMMEX
from .serializers import ClientesA24Serailizer,SerialiazerA24 from .serializers import ClientesA24Serailizer,SerialiazerA24
from rest_framework.authentication import TokenAuthentication from rest_framework.authentication import TokenAuthentication
from rest_framework.views import APIView 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.response import Response
from rest_framework import status from rest_framework import status
from rest_framework.permissions import IsAuthenticated from rest_framework.permissions import IsAuthenticated
@@ -77,12 +80,9 @@ class ClientesIMMEX_CreateView(CreateView):
return response return response
"""---------API VIEWS---------""" """---------API VIEWS---------"""
from rest_framework.authtoken.models import Token class LoginIMMEX(APIView):
from rest_framework import authentication, permissions, views authentication_classes = [TokenAuthentication]
permission_classes = [IsAuthenticated, HasAuthorizationHeader]
class LoginIMMEX(views.APIView):
authentication_classes = [authentication.TokenAuthentication]
permission_classes = [permissions.IsAuthenticated, permissions.HasAuthorizationHeader]
def post(self, request): def post(self, request):
try: try: