2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from apps.core.views import CustomAuthToken from apps.landing_view import index from django.conf import settings from django.conf.urls import url, include from django.conf.urls.static import static from django.contrib import admin from django.urls import path from rest_framework_simplejwt.views import TokenVerifyView, TokenRefreshView, TokenObtainPairView urlpatterns = [ url(r'^$', index, name='index'), url('api/', include('apps.core.urls'), name='core_urls'), url('api/task/', include('apps.task.urls'), name='task_urls'), # auth url(r'^auth/token/', CustomAuthToken.as_view(), name='token_auth'), # jwt path('jwt/token/', TokenObtainPairView.as_view(), name='jwt_token_obtain_pair'), path('jwt/token/refresh/', TokenRefreshView.as_view(), name='jwt_token_refresh'), path('jwt/token/verify/', TokenVerifyView.as_view(), name='jwt_token_verify'), # admin path('admin/', admin.site.urls), # oauth2_provider path('oauth2/', include('oauth2_provider.urls', namespace='oauth2_provider')), ] urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path, include from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, TokenVerifyView, ) urlpatterns = [ path("admin/", admin.site.urls), path("users/", include("users.urls")), path("posts/", include("posts.urls")), path("api-auth/", include("rest_framework.urls")), path("api/token/", TokenObtainPairView.as_view(), name="token_obtain_pair"), path("api/refresh/", TokenRefreshView.as_view(), name="token_refresh"), path("api/token/verify/", TokenVerifyView.as_view(), name="token_verify"), ]
r"^swagger/$", schema_view.with_ui("swagger", cache_timeout=0), name="schema-swagger-ui", ), url(r"^redoc/$", schema_view.with_ui("redoc", cache_timeout=0), name="schema-redoc"), # Rest API path("api/v1/auth/login/", TokenObtainPairView.as_view(), name="token_obtain_pair"), path("api/v1/auth/token/refresh/", TokenRefreshView.as_view(), name="token_refresh"), path("api/v1/auth/token/verify/", TokenVerifyView.as_view(), name="token_verify"), # Django Admin, use {% url 'admin:index' %} path(settings.ADMIN_URL, admin.site.urls), # User management path("users/", include("care.users.urls", namespace="users")), # path("accounts/", include("allauth.urls")), path("facility/", include("care.facility.urls", namespace="facility")), # RESTful APIs path("api/v1/", include(api_router.urlpatterns)), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) if settings.DEBUG: # This allows the error pages to be debugged during development, just visit # these url in browser to see how these error pages look like. urlpatterns += [
from rest_framework import routers from django.urls import include, path from . import views from .views import MangaViewSet, ChapterViewSet, PageViewSet, TagViewSet, CreateUserAPIView, ReportViewSet, ShowUserViewSet from rest_framework_simplejwt.views import (TokenObtainPairView, TokenRefreshView, TokenVerifyView) router = routers.DefaultRouter() router.register(r'manga', MangaViewSet, basename='manga') router.register(r'chapter', ChapterViewSet) router.register(r'page', PageViewSet) router.register(r'tag', TagViewSet) router.register(r'news', ReportViewSet) router.register(r'show_users', ShowUserViewSet) #router.register(r'manga/(?P<library_id>[0-9]+)', MangaViewSet, basename='manga') #router.register(r'manga/<name>', MangaUrlNameViewSet, basename='manga') #router.register(r'books/(?P<library_id>[0-9]+)', MangaUrlNameViewSet, base_name='books') urlpatterns = [ #$path('manga/url_name', views.MangaUrlNameViewSet.as_view(), name=mangaFiltered), path('userinfo/', views.GetUserInfo.as_view(), name='userinfo'), path('token/', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('token/refresh/', TokenRefreshView.as_view(), name='token_refresh'), path('token/check', TokenVerifyView.as_view(), name='token_checker'), path('create/', CreateUserAPIView.as_view()) ] urlpatterns += router.urls
from django.urls import path from rest_framework_simplejwt.views import (TokenObtainPairView, TokenRefreshView, TokenVerifyView) from .views import UserRegistration urlpatterns = [ path('auth/token', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('auth/token/refresh', TokenRefreshView.as_view(), name='token_refresh'), path('auth/token/verify', TokenVerifyView.as_view(), name='token_verify'), path('register', UserRegistration.as_view(), name="api_register") ]
from django.urls import path from .views import UserListView, UserCreateView, UserDetailView, UserFavoriteView, UserFavoriteCreateView, UserFavoriteRemoveView from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, TokenVerifyView, ) urlpatterns = [ path('', UserListView.as_view()), path('register/', UserCreateView.as_view(), name='register'), path('token/', TokenObtainPairView.as_view()), path('token/refresh/', TokenRefreshView.as_view()), path('token/token-verify/', TokenVerifyView.as_view()), path('favorites/', UserFavoriteView.as_view()), path('favorites/add/', UserFavoriteCreateView.as_view()), path('favorites/remove/', UserFavoriteRemoveView.as_view()), ]
router = DefaultRouter() router.register(r'users', UserViewSet) core_api_patterns = router.urls #Define schema for the api documentation schema_view = get_schema_view( openapi.Info( title="e-learning API", default_version='v1', description="This is the api documentation for a test api", contact=openapi.Contact(email="*****@*****.**"), license=openapi.License(name="BSD License"), ), public=True, permission_classes=(permissions.AllowAny, ), ) #Create an array with the urls api_patterns = [ #Core views url(r'^', include(core_api_patterns)), #Token url(r'^token-auth/', TokenObtainPairView.as_view()), url(r'^token-refresh/', TokenRefreshView.as_view()), url(r'^token-verify/', TokenVerifyView.as_view()), #docs url(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), ]
from django.urls import path from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, TokenVerifyView, ) from accounts import views app_name = "accounts" urlpatterns = [ path("token/", TokenObtainPairView.as_view(), name="token-obtain-pair"), path("token/refresh/", TokenRefreshView.as_view(), name="token-refresh"), path("token/verify/", TokenVerifyView.as_view(), name="token-verify"), path("signup/", views.SignUp.as_view(), name="signup"), ]
) from streams.apps.comments.views import ( create_post_comment, get_comments_for_post, get_new_comments_for_post, get_new_comments_for_post_count, ) urlpatterns = [ # admin path('admin/', admin.site.urls), # auth path('api/login', MyTokenObtainPairView.as_view(), name='token_obtain_pair'), path('api/refreshLogin', MyTokenRefreshView.as_view(), name='token_refresh'), path('api/verifyLogin', TokenVerifyView.as_view(), name='token_verify'), # account path('api/createAccount', create_account, name='create_account'), path('api/getAccount', get_account, name='get_account'), path('api/updateAccount', update_account, name='update_account'), path('api/deleteAccount', delete_account, name='delete_account'), # profile path('api/getProfile', get_profile, name='get_profile'), path('api/getMyProfile', get_my_profile, name='get_my_profile'), path('api/searchProfiles', search_profiles, name='search_profiles'), # streams path('api/getStream', get_stream, name='get_stream'), path('api/getStreamsForProfile', get_streams_for_profile, name='get_streams_for_profile'), path('api/createStream', create_stream, name='create_stream'), path('api/updateStream', update_stream, name='update_stream'), path('api/deleteStream', delete_stream, name='delete_stream'),
from django.urls import path from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView, TokenVerifyView from . import views urlpatterns = [ path("signup/", views.SingupView.as_view(), name="signup"), path("token/", TokenObtainPairView.as_view(), name='token_obtain'), path("token/refresh", TokenRefreshView.as_view(), name='token_refresh'), path("token/verify", TokenVerifyView.as_view(), name='token_verify'), path( "suggestions/", views.SuggestionListAPIView.as_view(), name="suggestion_user_list", ), path("follow/", views.user_follow, name="user_follow"), path("unfollow/", views.user_unfollow, name="user_unfollow"), ]
# from django.urls import path # from npo_jwt.views import NPOObtainTokenPairView # from rest_framework_simplejwt.views import TokenRefreshView # # # urlpatterns = [ # path('login/', NPOObtainTokenPairView.as_view(), name='token_obtain_pair'), # path('login/refresh/', TokenRefreshView.as_view(), name='token_refresh'), # ] from django.urls import path, include from rest_framework import routers from npo_jwt.views import NPOObtainTokenPairView, RegisterView, UserFilterSearch from rest_framework_simplejwt.views import TokenRefreshView, TokenVerifyView router = routers.DefaultRouter() router.register(r'', UserFilterSearch, 'filter') urlpatterns = [ path('login/', NPOObtainTokenPairView.as_view(), name='token_obtain_pair'), path('login/refresh/', TokenRefreshView.as_view(), name='token_refresh'), path('token-verify/', TokenVerifyView.as_view(), name='token_verify'), path('register/', RegisterView.as_view(), name='auth_register'), path('filter-user/', include(router.urls)), ]
path(r'api/accounts/', views.AccountAPIView.as_view(), name='account-list'), path(r'api/posts/', views.PostAPIView.as_view(), name='posts-list'), path(r'api/games/', views.GameAPIView.as_view(), name='games-list'), path(r'api/teamRegistrations/', views.TeamRegistrationAPIView.as_view(), name='game-registrations-list'), path('upload/', include('crmapp.urls')), path('posts/<pk>', views.getOnePost, ), path('api-token-auth/', obtain_auth_token, name='api_token_auth'), # Json Web Token path('api/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'), # JWT Token obtain path('api/current/', views.current_user, ), path(r'api/update_user/', views.ChangePasswordView.as_view(), name='update-user'), # trying regits path('api/register_user/', views.register_user, ), path(r'api/teams/', views.TeamViewSet), path('api/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'), # JWT Token refresh path('api/token/verify/', TokenVerifyView.as_view(), name='token_verify'), # HMAC , Hash- based message authentification code # Team View Set # Re-path rest to this location re_path(r'^association/(?P<path>.*)$', views.index), ]+static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from rest_framework.urlpatterns import format_suffix_patterns from rest_framework.documentation import include_docs_urls from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, TokenVerifyView, ) from provider.api_views.provider import ProviderAPIView from provider.api_views.service_area import ServiceAreaAPIView urlpatterns = [ url(r'^docs/', include_docs_urls(title='Mozio API')), url(r'^provider/', ProviderAPIView.as_view(), name="provider"), url(r'^service-area/', ServiceAreaAPIView.as_view(), name="service-area"), url(r'^token/', TokenObtainPairView.as_view(), name='token_obtain_pair'), url(r'^token/refresh/', TokenRefreshView.as_view(), name='token_refresh'), url(r'^token/verify/', TokenVerifyView.as_view(), name='token_verify'), ] urlpatterns = format_suffix_patterns(urlpatterns)
validators=['ssv'], public=True, permission_classes=(permissions.AllowAny,) ) urlpatterns = [ path('api/admin/', admin.site.urls), # jwt auth paths re_path(r'^api/token/$', GroupsTokenObtainPairView.as_view(), name='token_obtain_pair'), re_path(r'^api/token/refresh/$', TokenRefreshView.as_view(), name='token_refresh'), re_path(r'^api/token/verify/$', TokenVerifyView.as_view(), name='token_verify'), # used for clients to retrieve non-sensitive token info if using httponly cookies re_path(r'^api/token/info/$', TokenInfo.as_view(), name='token_info'), re_path(r'^api/token/invalidate/$', TokenInvalidate.as_view(), name='token_invalidate'), # drf routes path('api/v1/', include('api.urls')), re_path(r'^api/api-auth/', include('rest_framework.urls', namespace='rest_framework')), # drf-yasg routes re_path(r'^api/v1/swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'), re_path(r'^api/v1/swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path, include from django.conf.urls import url from django.views.generic.base import TemplateView from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, TokenVerifyView, ) from rest_auth.registration.views import RegisterView from shout_app.authentication.views import EmailConfirmAPIView urlpatterns = [ path('', TemplateView.as_view(template_name='home.html'), name='home'), # path('admin/', admin.site.urls), path('', include('shout_app.authentication.urls')), path('', include('shout_app.profile.urls')), path('', include('shout_app.shouts.urls')), path('api/request-auth-token', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('api/request-auth-token/refresh', TokenRefreshView.as_view(), name='token_refresh'), path('api/request-auth-token/verify', TokenVerifyView.as_view(), name='token_verify'), path('api/signup/', RegisterView.as_view(), name='account_signup'), url('confirm_email/(?P<key>[-:\w]+)/$', EmailConfirmAPIView.as_view(), name='account_confirm_email') ]
from django.urls import path from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, TokenVerifyView, ) from accounts.views.token import UNamurTokenObtainPairView urlpatterns = [ # /api/token/login/ path("login/", TokenObtainPairView.as_view(), name="login"), # /api/token/refresh/ path("refresh/", TokenRefreshView.as_view(), name="refresh"), # /api/token/verify/ path("verify/", TokenVerifyView.as_view(), name="verify"), # /api/token/login_by_unamur/ path( "login_by_unamur/", UNamurTokenObtainPairView.as_view(), name="login_unamur", ), ]
from django.contrib import admin from django.urls import path, include from django.conf.urls.static import static from django.conf import settings from rest_framework_simplejwt.views import ( TokenRefreshView, TokenVerifyView, ) urlpatterns = [ path("api/v1/token/refresh/", TokenRefreshView.as_view()), path("api/v1/token/verify/", TokenVerifyView.as_view()), path("api/v1/user/", include("user.urls")), path("api/v1/article/", include("mlarticles.urls")), path("ckeditor/", include("ckeditor_uploader.urls")), path("admin/", admin.site.urls), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.urls import path from myapp.views import * from rest_framework_simplejwt.views import TokenObtainPairView,TokenRefreshView,TokenVerifyView urlpatterns = [ path('register/',Register.as_view()), path('login/',LoginView.as_view()), path('get/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('refresh/token/',TokenRefreshView.as_view()), path('verify/token',TokenVerifyView.as_view()), ]
from django.urls import path from rest_framework_simplejwt.views import TokenRefreshView, TokenVerifyView from deep_trust_app.registration.views import RegistrationView, RegistrationValidationView, TokenUserObtainView, \ PasswordResetView, \ PasswordResetValidationView, PsychologistRegistrationView app_name = 'registration' urlpatterns = [ path('token/', TokenUserObtainView.as_view(), name='retrieve-token-and-user'), path('token/refresh/', TokenRefreshView.as_view(), name='retrieve-refreshed-token'), path('token/verify/', TokenVerifyView.as_view(), name='verify-token'), path('registration/', RegistrationView.as_view(), name='registration'), path('registration/psychologist/', PsychologistRegistrationView.as_view(), name='registration'), path('registration/validation/', RegistrationValidationView.as_view(), name='registration-validation'), path('password-reset/', PasswordResetView.as_view(), name='password-reset'), path('password-reset/validation/', PasswordResetValidationView.as_view(), name='password-reset-validation'), ]
from .tokenSerializer import MyTokenObtainPairView from django.conf.urls import url,include from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, TokenVerifyView, ) urlpatterns = [ url(r'^eventmanager/',include('eventmanager.urls',namespace='event')), url(r'^accounts/',include('accounts.urls')), url(r'^admin/', admin.site.urls), url(r'^api/user/',include('accounts.api.urls',namespace='api-user')), url(r'^api/event/',include('eventmanager.api.urls',namespace='api-event')), url(r'^api/token/$', MyTokenObtainPairView.as_view(), name='token_obtain_pair'), url(r'^api/token/refresh/$', TokenRefreshView.as_view(), name='token_refresh'), url(r'^api/token/verify/$', TokenVerifyView.as_view(), name='token_verify'), ] urlpatterns += staticfiles_urlpatterns()
openapi.Info( title="Documentation API", default_version='v1', description="Test description", terms_of_service="https://127.0.0.1:8000", contact=openapi.Contact(email="*****@*****.**"), license=openapi.License(name="My License"), ), public=True, permission_classes=[permissions.AllowAny], ) urlpatterns = [ # my methods path('message/', include('message_getter.urls')), path('admin/', admin.site.urls), path('api/', include('rest_framework.urls')), # token auth path('auth/', include('djoser.urls')), path('auth/', include('djoser.urls.authtoken')), path('auth/', include('djoser.urls.jwt')), # jwt auth path('api/token/', TokenObtainPairView.as_view()), path('api/token/refresh/', TokenRefreshView.as_view()), path('api/token/verify/', TokenVerifyView.as_view()), ] + [ path('swagger(?<format>\.json|\.yaml)', schema_view.without_ui(cache_timeout=0)), path('swagger/', schema_view.with_ui('swagger', cache_timeout=0)), path('redoc/', schema_view.with_ui('redoc', cache_timeout=0)), ]
from drf_yasg.views import get_schema_view from drf_yasg import openapi schema_view = get_schema_view( openapi.Info( title="Napoleão", default_version='v1', description="cashback calculator", terms_of_service="https://policies.google.com/terms", contact=openapi.Contact(email="rbraga@local"), license=openapi.License(name="BSD License"), ), public=True, permission_classes=[permissions.AllowAny], ) urlpatterns = [ path('admin/', admin.site.urls), path("auth/token/", obtain.as_view(), name="token_obtain_pair"), path("auth/token/refresh/", refresh.as_view(), name="token_refresh"), path("auth/token/verify/", verify.as_view(), name="token_verify"), path("users/", include("users.urls", namespace="users")), path("sales/", include("sales.urls", namespace="sales")), re_path(r'swagger(?P<format>\.json|\.yaml)', schema_view.without_ui(cache_timeout=0), name='schema-json'), path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), ]
The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path, include from rest_framework_simplejwt.views import (TokenObtainPairView, TokenRefreshView, TokenVerifyView) from MVP.routers import ROUTER from auth.viewsets import RegisterView urlpatterns = [ path('admin/', admin.site.urls), path("api-register/", RegisterView.as_view()), path("api-token-auth/", TokenObtainPairView.as_view()), path("api-token-verify/", TokenVerifyView.as_view()), path("api-token-refresh/", TokenRefreshView.as_view()), path("api/v1/", include((ROUTER.urls, "api"), namespace="v1")), ]
class VerifyTokenView(TokenVerifyView): # renderer_classes = (CustomJSONRenderer,) token_verify = TokenVerifyView.as_view()
"""django_project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path, include from rest_framework_simplejwt.views import TokenVerifyView, TokenObtainPairView, TokenRefreshView urlpatterns = [ path('admin/', admin.site.urls), path('', include('django_app.urls')), path('auth/', include('rest_framework.urls')), path('login/', TokenObtainPairView.as_view()), path('refresh/', TokenRefreshView.as_view()), path('profile/', TokenVerifyView.as_view()) ]
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView, TokenVerifyView from django.conf.urls import url, include from django.contrib.auth.models import User from rest_framework import routers from aims.serializers import UserSerializer from aims.viewsets import UserViewSet # Routers provide an easy way of automatically determining the URL conf. router = routers.DefaultRouter() router.register(r'users', UserViewSet) # Wire up our API using automatic URL routing. # Additionally, we include login URLs for the browsable API. urlpatterns = [ url(r'^', include(router.urls)), url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), url(r'^api/token/$', TokenObtainPairView.as_view(), name='token_obtain_pair'), #issue token route url(r'^api/token/refresh/$', TokenRefreshView.as_view(), name='token_refresh'), #refresh token route url(r'^api/token/verify/$', TokenVerifyView.as_view(), name='token_verify'), #token evrification for users route ]
from django.contrib import admin from django.urls import path, include from api import views from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView, TokenVerifyView urlpatterns = [ # path('student-list/', views.student_list), # path('stuinfo/<int:pk>', views.student_detail), # path('student-create/', views.student_create), path('employee-list/', views.Employee.as_view()), path('employee/<int:pk>', views.EmployeeUpdated.as_view()), path('course-details/', views.CourseList.as_view(), name='course_details'), path('course-details-list/', views.CourseDetailsList.as_view(), name='course_details_list'), path('course-details-condt/', views.getData, name='course_details_condt'), path('gettoken/', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('refresh-token/', TokenRefreshView.as_view(), name='token_refresh'), path('verify-token/', TokenVerifyView.as_view(), name='token_verify'), path('check-celery/', views.checkCelery, name='checkCelery') ]
Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path from django.conf.urls import url, include from rest_framework_simplejwt.views import TokenRefreshView, TokenVerifyView from auth.for_jwt import UserTokenObtainPairView from apps_app.views import GetTokenPairForApp, VerifyTokenForApp, RefreshTokenForApp urlpatterns = [ path('admin/', admin.site.urls), url(r'^api/api-token-auth/', UserTokenObtainPairView.as_view()), url(r'^api/api-token-refresh/', TokenRefreshView.as_view()), url(r'^api/api-token-verify/', TokenVerifyView.as_view()), url(r'^api/app-token-auth/', GetTokenPairForApp.as_view()), url(r'^api/app-token-verify/', VerifyTokenForApp.as_view()), url(r'^api/app-token-refresh/', RefreshTokenForApp.as_view()), url(r'', include('auth_app.urls')), url(r'', include('apps_app.urls')), url(r'', include('users_app.urls')), ]
from django.contrib import admin from django.urls import path, include from rest_framework import routers from userauth import views from rest_framework_simplejwt.views import (TokenObtainPairView, TokenRefreshView, TokenVerifyView) router = routers.DefaultRouter() router.register("user", views.UserViewSet, basename="user") router.register("todos", views.TodoViewSet, basename="todos") urlpatterns = [ path('admin/', admin.site.urls), path('api/', include(router.urls)), path('api/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('api/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'), path('api/token/verify/', TokenVerifyView.as_view(), name='token_verify'), ]
from django.urls import path from rest_framework_simplejwt.views import (TokenVerifyView, TokenRefreshView) from django.conf.urls.static import static from django.conf import settings from apps.authentication.views.sponsor import SponsorCreateAccountView from apps.authentication.views.student import StudentCreateAccountView from apps.authentication.views.staff import CustomTokenObtainView urlpatterns = [ path('token/', CustomTokenObtainView.as_view()), path('sponsor/join/', SponsorCreateAccountView.as_view()), path('student/register/', StudentCreateAccountView.as_view()), path('token/refresh', TokenRefreshView.as_view()), path('token/verify', TokenVerifyView.as_view()) ] urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)