This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.auth import mixins | |
from rest_framework.authentication import SessionAuthentication | |
from rest_framework.authentication import TokenAuthentication | |
from rest_framework import generics | |
class TokenLoginRequiredMixin(mixins.LoginRequiredMixin): | |
"""A login required mixin that allows token authentication.""" | |
def dispatch(self, request, *args, **kwargs): |