Created
July 31, 2018 20:12
-
-
Save jamesalbert/abc27109b38ab02fa3ebe6bbff5599f4 to your computer and use it in GitHub Desktop.
custom auth
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.urls import re_path | |
from rest_framework.authtoken.views import ObtainAuthToken | |
from .serializers import AuthTokenSerializer | |
ObtainAuthToken.serializer_class = AuthTokenSerializer | |
obtain_auth_token = ObtainAuthToken.as_view() | |
urlpatterns = [ | |
re_path(r'^api-token-auth/$', obtain_auth_token) | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment