Skip to content

Instantly share code, notes, and snippets.

@jamesalbert
Created July 31, 2018 20:12
Show Gist options
  • Save jamesalbert/abc27109b38ab02fa3ebe6bbff5599f4 to your computer and use it in GitHub Desktop.
Save jamesalbert/abc27109b38ab02fa3ebe6bbff5599f4 to your computer and use it in GitHub Desktop.
custom auth
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