Skip to content

Instantly share code, notes, and snippets.

@BrockHerion
Created August 27, 2020 01:13
Show Gist options
  • Save BrockHerion/90b68487565eadbdbb5e4e3e60df1359 to your computer and use it in GitHub Desktop.
Save BrockHerion/90b68487565eadbdbb5e4e3e60df1359 to your computer and use it in GitHub Desktop.
URLs for Django Rest
from django.urls import path
from rest_framework_simplejwt import views as jwt_views
from .views import (
UserRegistrationView,
UserLoginView,
UserListView
)
urlpatterns = [
path('token/obtain/', jwt_views.TokenObtainPairView.as_view(), name='token_create'),
path('token/refresh/', jwt_views.TokenRefreshView.as_view(), name='token_refresh'),
path('register', UserRegistrationView.as_view(), name='register'),
path('login', UserLoginView.as_view(), name='login'),
path('users', UserListView.as_view(), name='users')
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment