|
|
|
@ -4,6 +4,7 @@ from django.contrib.auth import authenticate |
|
|
|
from django.utils.decorators import method_decorator |
|
|
|
from django.utils.decorators import method_decorator |
|
|
|
from django.core.exceptions import ObjectDoesNotExist |
|
|
|
from django.core.exceptions import ObjectDoesNotExist |
|
|
|
from django.conf import settings |
|
|
|
from django.conf import settings |
|
|
|
|
|
|
|
from django.contrib.auth import get_user_model |
|
|
|
|
|
|
|
|
|
|
|
from rest_framework.views import APIView |
|
|
|
from rest_framework.views import APIView |
|
|
|
from rest_framework.response import Response |
|
|
|
from rest_framework.response import Response |
|
|
|
@ -17,7 +18,7 @@ from .models import Device, LoginLog |
|
|
|
|
|
|
|
|
|
|
|
from .serializers import ChangePasswordSerializer |
|
|
|
from .serializers import ChangePasswordSerializer |
|
|
|
|
|
|
|
|
|
|
|
CustomUser=settings.AUTH_USER_MODEL |
|
|
|
CustomUser=get_user_model() |
|
|
|
|
|
|
|
|
|
|
|
@method_decorator(csrf_exempt, name='dispatch') |
|
|
|
@method_decorator(csrf_exempt, name='dispatch') |
|
|
|
class CustomAuthToken(APIView): |
|
|
|
class CustomAuthToken(APIView): |
|
|
|
|