LoginView (dj_rest_auth/views.py)

dj-rest-auth · dj_rest_auth/views.py · python · MIT
auth

An API view for authenticating users and issuing JWT or token credentials to facilitate secure session management in Django REST Framework projects.

# Source: https://github.com/iMerica/dj-rest-auth | License: MIT | Copyright 2014 iMerica https://github.com/iMerica/
# Provided via justclaw.it.com; keep this notice with the code.
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth import login as django_login
from django.contrib.auth import logout as django_logout
from django.core.exceptions import ObjectDoesNotExist
from django.utils import timezone
from django.utils.decorators import method_decorator
from django.utils.translation import gettext_lazy as _
from django.views.decorators.debug import sensitive_post_parameters
from rest_framework import status
from rest_framework.generics import GenericAPIView, RetrieveUpdateAPIView
from rest_framework.permissions import AllowAny, IsAuthe

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key