The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.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 include, path, re_path from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView admin.site.site_header = 'PackOne Console' # default: "Django Administration" admin.site.index_title = 'Dashboard' # default: "Site administration" admin.site.site_title = 'PackOne Console' # default: "Django site admin" admin.site.site_url = None urlpatterns = [ re_path(r'^', admin.site.urls), path('api/user/', include('user.urls')), path('api/clouds/', include('clouds.urls')), path('api/engines/', include('engines.urls')), # path('api/data/', include('data.urls')), re_path(r'^api/token/$', TokenObtainPairView.as_view(), name='token_obtain_pair'), re_path(r'^api/token/refresh/$', TokenRefreshView.as_view(), name='token_refresh'), ]
from django.contrib import admin from django.urls import path from django.conf import settings from django_mongoengine import mongo_admin from blogapp.views import BlogAPI, BlogDetailsBy_ID, PostDetail, PostList from user.views import Register from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, TokenVerifyView, ) urlpatterns = [ path('admin/', admin.site.urls), path('mongoadmin/', mongo_admin.site.urls), path('blogdata/', BlogAPI.as_view()), path('blogid/<str:id>/', BlogDetailsBy_ID.as_view()), path('register/', Register.as_view()), path('postt', PostList.as_view(), name='home'), path('podetail/', PostDetail.as_view(), name='post_detail'), path('api/token/verify/', TokenVerifyView.as_view(), name='token_verify'), path('api/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('api/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'), path('register/', RegisterView.as_view()), ]
from django.contrib import admin from django.urls import path, include from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView urlpatterns = [ path('admin/', admin.site.urls), path("api/users/", include("users.urls")), path("api/products/", include("products.urls")), path("api/public_products/", include("public_products.urls")), path("api/token/", TokenObtainPairView.as_view(), name="token_obtain_pair"), path("api/refresh/", TokenRefreshView.as_view(), name="token_refresh"), ]
UserAllListApiView, UserDetailApiView, ) from account.views.token import ( ObainRestFrameworkAuthTokenApiView, JwtTokenObtainPairView ) urlpatterns = [ # 前缀:/api/v1/account/user/ # 登录、退出 path("login", LoginView.as_view(), name="login"), path("logout", user_logout, name="logout"), # token相关: path('api-auth-token', ObainRestFrameworkAuthTokenApiView.as_view(), name="api-auth-token"), path('drf-token', ObainRestFrameworkAuthTokenApiView.as_view(), name="drf-token"), path('token', ObainRestFrameworkAuthTokenApiView.as_view(), name="token"), # DRF Token使用示例: curl http://127.0.0.1:8000/api/v1/account/info --header 'Authorization:Token TOKEN_VALUE' path('jwt-token', JwtTokenObtainPairView.as_view(), name="jwt-token"), path('jwt-token-refresh', TokenRefreshView.as_view(), name="jwt-token-refresh"), # 用户相关api path("list", UserListApiView.as_view(), name="list"), path("all", UserAllListApiView.as_view(), name="all"), path('<int:pk>', UserDetailApiView.as_view(), name="detail"), path('<str:username>', UserDetailApiView.as_view(lookup_field="username"), name="detail2"), # 密码相关 ]
router = DefaultRouter() schema_view = get_schema_view( openapi.Info( title="Cicloh API's", default_version='v1', description="Cicloh Apps API's", terms_of_service="Cicloh", ), public=True, permission_classes=(permissions.AllowAny,), ) urlpatterns = [ path( 'swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui' ), path('api-auth/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('api-auth/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'), path('admin/', admin.site.urls), path('', admin.site.urls), path('api/', include(router.urls)), path("api/products/", include("products.urls")), path("api/orders/", include("orders.urls")), ]
from django.conf.urls import url from django.urls import path, include from rest_framework import routers from rest_framework_simplejwt.views import TokenRefreshView from . import views from .views import CustomClaimsTokenObtainPairView router = routers.DefaultRouter() router.register('users', views.UserViewSet, basename='user') additional_urls = [ url(r'^password_reset/', include('django_rest_passwordreset.urls', namespace='password_reset')), path('token/', CustomClaimsTokenObtainPairView.as_view(), name='token-obtain-pair'), path('token/refresh/', TokenRefreshView.as_view(), name='token-refresh'), ]
from .views import PlanViewSet, SubscriptionViewSet, DetectionViewSet, RegisterView urlpatterns = [ path('plan', PlanViewSet.as_view({ 'get': 'list', })), path('subscription', SubscriptionViewSet.as_view({ 'post': 'create', 'get': 'retrieve', })), path('detection', DetectionViewSet.as_view({ 'get': 'list', 'post': 'upload', })), path('detection/<int:detection_id>', DetectionViewSet.as_view({ 'get': 'retrieve', 'patch': 'detect', })), path('detection/<int:detection_id>/progress/<str:task_id>', DetectionViewSet.as_view({ 'get': 'progress', })), path('docs/', TemplateView.as_view( template_name='api-docs.html', ), name='api-docs'), path('login', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('login/refresh', TokenRefreshView.as_view(), name='token_refresh'), path('login/verify', TokenVerifyView.as_view(), name='token_verify'), path('register', RegisterView.as_view(), name='auth_register') ]
from django.conf.urls import url from . import views from rest_framework_simplejwt.views import TokenRefreshView urlpatterns = [ url(r"login/$", views.login), url(r"^token/refresh/$", TokenRefreshView.as_view(), name="token_refresh"), ]
"""SocialNetwork URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/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) urlpatterns = [ path('admin/', admin.site.urls), path('api/', include('api.urls', namespace='api')), # JWT related views path('api/login/', TokenObtainPairView.as_view()), path('api/token-refresh/', TokenRefreshView.as_view()) ]
from django.contrib import admin from django.urls import path, include from rest_framework_simplejwt.views import TokenRefreshView, TokenObtainPairView urlpatterns = [ path('', include('core.urls')), path('api/', include('api.urls', namespace='api')), path('api/login/', TokenObtainPairView.as_view(), name='api-login'), path('api/refresh/', TokenRefreshView.as_view(), name='api-refresh'), path('admin/', admin.site.urls), ]
urlpatterns = [ # access to jet dashboard #path('jet/',include('jet.urls','jet')), #path('jet/dashboard/', include('jet.dashboard.urls', 'jet-dashboard')), #============================================== path('admin/', admin.site.urls), #============================================== # this urls route you to Users app urls.py path('Users/App/' , include('Users.urls')), #============================================== # this urls route you to Users app urls.py path('News/App/' , include('News.urls')), #============================================== # this urls route you to Users app urls.py path('Classes/App/' , include('Classes.urls')), #============================================== #============================================== # this urls route you to Tutorial app urls.py path('Tutorial/App/' , include('Tutorial.urls')), #============================================== #============================================== # this urls route you to Tutorial app urls.py path('ClassActivity/App/' , include('ClassActivity.urls')), #============================================== # token urls path('api/login/',CustomTokenObtainPairView.as_view(),name='TokenObtainPairView'), path('api/token/refresh/',TokenRefreshView.as_view(),name='TokenRefreshView'), #============================================== ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
import track_actions app_name = 'posts' urlpatterns = [ path('admin/', admin.site.urls), path('api-auth/', include('rest_framework.urls')), # The Browsable API login page path('api-auth/login/', include('rest_framework.urls')), # User Registrations path('auth/', include('djoser.urls')), # path('auth/', include('djoser.urls.authtoken')), # JWT Authentication path('auth/api/token/', TokenObtainPairView.as_view(), name='token_obtain_pair_url'), path('auth/api/token/refresh/', TokenRefreshView.as_view(), name='token_refresh_pair_url'), # Apps path('profiles/', include('profiles.urls', namespace='profiles')), path('posts/', include('posts.urls', namespace='posts')), # Apps API path('api/posts/', include('posts.api.urls', 'posts_api')), path('api/history/', include('history.api.urls', 'history_api')), path('track_actions/', include('track_actions.urls')), ] urlpatterns += doc_urls if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
from v1.tasks.urls import router as tasks_router from v1.teams.urls import router as teams_router from v1.users.urls import router as users_router admin.site.index_title = 'Admin' admin.site.site_header = 'thenewboston' admin.site.site_title = 'thenewboston' urlpatterns = [ # Core path('admin/', admin.site.urls), # Auth path('login', LoginView.as_view(), name='login'), path('refresh_token', TokenRefreshView.as_view(), name='refresh_token'), # OpenAPI Schema UI path('schema/', SpectacularAPIView.as_view(), name='schema'), path('schema/swagger-ui/', SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'), path('schema/redoc/', SpectacularRedocView.as_view(url_name='schema'), name='redoc'), ] router = DefaultRouter(trailing_slash=False) router.registry.extend(openings_router.registry) router.registry.extend(tasks_router.registry)
from django.contrib import admin from django.urls import path, include from rest_framework import routers from DjangoMedicalApp import views from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView router=routers.DefaultRouter() router.register("company", views.CompanyViewSet, basename="company") router.register("companybank", views.CompanyBankViewSet, basename="companybank") router.register("medicine", views.MedicineViewSet, basename="medicine") urlpatterns = [ path('admin/', admin.site.urls), path('api/', include(router.urls)), path('api/gettoken/', TokenObtainPairView.as_view(), name="gettoken"), path('api/refresh_token/', TokenRefreshView.as_view(), name="refresh_token"), path('api/companybyname/<str:name>', views.CompanyNameViewSet.as_view(), name="companybyname"), # #? APIs # path( # 'api/company/', # views.CompanyViewSet.as_view(), # name="company" # ), # path( # 'api/company/<int:company_id>', # views.CompanyViewSet.as_view(), # name="company-one" # ), # path( # 'api/company/<int:company_id>/delete',
"""ct5000_python URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.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 django.conf import settings from django.conf.urls.static import static from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView urlpatterns = [ path('api/admin/', admin.site.urls), path('api/', include('api.urls')), path('api/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('api/token/refresh/', TokenRefreshView.as_view(), name='token_obtain_pair'), ]
"""Authentication URL Configuration.""" from django.urls import path from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, ) app_name = "authentication" urlpatterns = [ path("auth/token/", TokenObtainPairView.as_view(), name="obtain_token"), path("auth/refresh/", TokenRefreshView.as_view(), name="refresh_token"), ]
from django.urls import path, include from rest_framework.routers import DefaultRouter from .views import ( TitleViewSet, CategoryViewSet, GenreViewSet, ReviewViewSet, CommentViewSet, GetToken, RegistrationView, MyProfile, UserViewSet ) from rest_framework_simplejwt.views import TokenRefreshView router = DefaultRouter() router.register('categories', CategoryViewSet) router.register('genres', GenreViewSet) router.register('titles', TitleViewSet) router.register(r'titles/(?P<title_id>\d+)/reviews', ReviewViewSet, basename='reviews') router.register( r'titles/(?P<title_id>\d+)/reviews/(?P<review_id>\d+)/comments', CommentViewSet, basename='comments') router.register('users', UserViewSet) urlpatterns = [ path('auth/token/', GetToken.as_view(), name='get_token'), path( 'auth/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'), path('auth/email/', RegistrationView.as_view()), path('users/me/', MyProfile.as_view()), path('', include(router.urls)), ]
"""socialnetwork URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/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 TokenRefreshView, TokenVerifyView from posts.views import TokenAuthView urlpatterns = [ path('admin/', admin.site.urls), path('auth/', include('djoser.urls')), path('auth/jwt/create/', TokenAuthView.as_view(), name='jwt-create'), path('auth/jwt/refresh/', TokenRefreshView.as_view(), name='jwt-refresh'), path('auth/jwt/verify/', TokenVerifyView.as_view(), name='jwt-verify'), path('api/', include('posts.urls')), ]
from . import views from django.urls import path from rest_framework import routers from rest_framework_simplejwt.views import TokenRefreshView, TokenVerifyView, TokenObtainPairView router = routers.SimpleRouter() router.register('pichangas', views.PichangaViewSet, basename='pichangas') router.register('users', views.UserViewSet, basename='users') router.register('profiles', views.ProfileViewSet, basename='profiles') urlpatterns = [ path('pictures/', views.PictureView.as_view(), name='pictures'), path('sports/', views.SportViewSet.as_view(), name='sports'), path('login/', TokenObtainPairView.as_view(), name='login'), path('register/', views.RegisterView.as_view(), name='register'), path('refresh/', TokenRefreshView.as_view(), name='refresh'), path('token/verify/', TokenVerifyView.as_view(), name='verify'), ] urlpatterns = urlpatterns + router.urls
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.urls import path, include from accounting import views from django.conf import settings from django.conf.urls.static import static from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, TokenVerifyView, ) urlpatterns = [ path('api/v1/', include('accounting.urls')), path('api/auth/verify/', TokenVerifyView.as_view(), name='token_verify'), path('api/auth/refresh/', TokenRefreshView.as_view(), name='token_refresh'), path('api/auth/', TokenObtainPairView.as_view(), name='token_obtain_pair'), ] # urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
from django.urls import path from rest_framework_simplejwt.views import ( TokenRefreshView, ) from .custom_claims import MyTokenObtainPairView from .views import registration urlpatterns = [ # path('login/', TokenObtainPairView.as_view()), path("register/", registration, name="register"), path('login/', MyTokenObtainPairView.as_view()), path('token/refresh/', TokenRefreshView.as_view()), ]
from django.urls import path, include from rest_framework.routers import DefaultRouter from rest_framework_simplejwt.views import (TokenObtainPairView, TokenRefreshView) from .views import AuthViewSet router = DefaultRouter() router.register(r'auth', AuthViewSet, basename='auth') urlpatterns = [ path('users/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('users/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'), path('', include(router.urls)), ]
from django.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.urls import path , include, re_path #from django.views.generic import TemplateView from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView urlpatterns = [ path('api-auth', include('rest_framework.urls')), path('api/token/', TokenObtainPairView.as_view(),name='token_obtain_pair'), path('api/token/refresh/', TokenRefreshView.as_view(),name='token_refesh'), path('api/accounts/', include('accounts.urls')), path('api/realtors', include('realtors.urls')), path('api/listings/', include('listings.urls')), path('api/contacts/', include('contacts.urls')), path('admin/', admin.site.urls), ] # if settings.DEBUG: # import debug_toolbar # urlpatterns = [ # path('__debug__/', include(debug_toolbar.urls)), # ]+urlpatterns
from django.urls import path, include from .views import SendConfirmOtpToEmail, ConfirmEmailOTP, RegisteringNewUser, UserView from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView urlpatterns = [ path('/auth/token/', TokenObtainPairView.as_view()), path('/auth/token/refresh', TokenRefreshView.as_view()), path('/auth/registrate/send_email/', SendConfirmOtpToEmail.as_view()), path('/auth/registrate/confirm_email/', ConfirmEmailOTP.as_view()), path('/auth/registrate/me/', RegisteringNewUser.as_view()), path('/auth/me/', UserView.as_view()), ]
from django.contrib import admin from django.urls import path, include, re_path from django.views.generic import TemplateView from django.conf import settings from django.conf.urls.static import static from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView urlpatterns = [ path('api-auth/', include('rest_framework.urls')), path('api/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('api/token/refresh', TokenRefreshView.as_view(), name='token_refresh'), path('api/accounts/', include('accounts.urls')), path('admin/', admin.site.urls), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns += [ re_path(r'^.*', TemplateView.as_view(template_name='index.html')) ]
from django.urls import path from rest_framework import routers from rest_framework_simplejwt.views import TokenRefreshView from users.viewsets import AuthViewSet, UserViewSet, MyTokenObtainPairView, SearchUsersViewSet router = routers.DefaultRouter() router.register('auth', AuthViewSet, basename='auth') router.register('user', UserViewSet, basename='user') router.register('search', SearchUsersViewSet, basename='search') urlpatterns = [ path('auth/login/', MyTokenObtainPairView.as_view()), path('auth/refresh-token/', TokenRefreshView.as_view()), # path('auth/password/change') ] urlpatterns += router.urls
from django.urls import path, include from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, ) from rest_framework.routers import DefaultRouter from .views import PostViewSet, CommentViewSet, GroupViewSet, FollowViewSet v1_router = DefaultRouter() v1_router.register('posts', PostViewSet, basename='posts') v1_router.register('group', GroupViewSet, basename='group') v1_router.register('follow', FollowViewSet, basename='follow') v1_router.register('posts/<int:post_id>/', PostViewSet, basename='posts') v1_router.register(r'posts/(?P<post_id>\d+)/comments', CommentViewSet, basename='comments') urlpatterns = [ path('v1/', include(v1_router.urls)), path('v1/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('v1/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'), ]
from django.contrib.auth import views as auth_views from django.views.generic import TemplateView from django.views.static import serve from apps.core import views as users_views from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView, TokenVerifyView admin.site.index_title = 'OPL Database' urlpatterns = [ path('admin/', admin.site.urls), path('nested_admin/', include('nested_admin.urls')), path('grappelli/', include('grappelli.urls')), url(r'^api/v1/token/$', TokenObtainPairView.as_view(), name='token_obtain_pair'), url(r'^api/v1/token/refresh/$', TokenRefreshView.as_view(), name='token_refresh'), url(r'^api/v1/token/verify/$', TokenVerifyView.as_view(), name='token_verify'), url(r'^staticfiles/(?P<path>.*)$', serve, kwargs=dict(document_root=settings.STATIC_ROOT)), url(r'', include('apps.core.urls', namespace='core')), # path('register/', users_views.register, name='register'), # path('profile/', users_views.profile, name='profile'), # path('login/', auth_views.LoginView.as_view(template_name='core/login.html'), name='login'), # path('logout/', auth_views.LogoutView.as_view(template_name='core/logout.html'), name='logout'), url(r'^', TemplateView.as_view(template_name="index.html")), ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.urls import path, include from rest_framework.routers import DefaultRouter from rest_framework_simplejwt.views import TokenRefreshView from posts import views as post_views from . import views router = DefaultRouter() # Core router.register('auth', views.AuthViewSet, basename='auth') router.register('users', views.UserViewSet, basename='users') # Posts router.register('posts', post_views.PostsViewSet, basename='posts') urlpatterns = [ path('', include(router.urls)), path('auth/refresh/', TokenRefreshView.as_view(), name='token_refresh'), ]
router.register(r'api/faces', views.FaceViewSet) urlpatterns = [ url(r'^', include(router.urls)), url(r'^admin/', admin.site.urls), url(r'^api/facetolabel', views.FaceToLabelView.as_view()), url(r'^api/trainfaces', views.TrainFaceView.as_view()), url(r'^api/clusterfaces', views.ClusterFaceView.as_view()), url(r'^api/socialgraph', views.SocialGraphView.as_view()), url(r'^api/egograph', views.EgoGraphView.as_view()), url(r'^api/scanphotos', views.ScanPhotosView.as_view()), url(r'^api/autoalbumgen', views.AutoAlbumGenerateView.as_view()), url(r'^api/searchtermexamples', views.SearchTermExamples.as_view()), url(r'^api/locationsunburst', views.LocationSunburst.as_view()), url(r'^api/locationtimeline', views.LocationTimeline.as_view()), url(r'^api/stats', views.StatsView.as_view()), url(r'^api/locclust', views.LocationClustersView.as_view()), url(r'^api/photocountrycounts', views.PhotoCountryCountsView.as_view()), url(r'^api/photomonthcounts', views.PhotoMonthCountsView.as_view()), url(r'^api/wordcloud', views.SearchTermWordCloudView.as_view()), url(r'^api/watcher/photo', views.IsPhotosBeingAddedView.as_view()), url(r'^api/watcher/autoalbum', views.IsAutoAlbumsBeingProcessed.as_view()), url(r'^api/auth/token/obtain/$', TokenObtainPairView.as_view()), url(r'^api/auth/token/refresh/$', TokenRefreshView.as_view()), # url(r'^media/(?P<path>.*)', media_access, name='media'), # url(r'^api/token-auth/', obtain_jwt_token), # url(r'^api/token-refresh/', refresh_jwt_token), # url(r'^api/token-verify/', verify_jwt_token), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
TokenObtainPairView, TokenRefreshView, ) from rest_framework import views, serializers, status from rest_framework.response import Response class EchoView(views.APIView): def post(self, request, *args, **kwargs): serializer = MessageSerializer(data=request.data) serializer.is_valid(raise_exception=True) return Response( serializer.data, status=status.HTTP_201_CREATED) urlpatterns = [ url(r'^$', generic.RedirectView.as_view( url='/api/', permanent=False)), url(r'^api/$', get_schema_view()), url(r'^api/auth/', include( 'rest_framework.urls', namespace='rest_framework')), url(r'^api/auth/token/obtain/$', TokenObtainPairView.as_view()), url(r'^api/auth/token/refresh/$', TokenRefreshView.as_view()), url(r'^api/echo$', EchoView.as_view()) ]
from django.urls import path, include from . import views from rest_framework_simplejwt.views import TokenRefreshView urlpatterns = [ path('v1/signup', views.SignupApiView.as_view(), name="sign_up"), path('v1/login', views.LoginApiView.as_view(), name="login"), path('v1/token/refresh', TokenRefreshView.as_view(), name="token_refresh"), path('v1/trip', views.TripApiView.as_view(), name="trip_list"), path('v1/trip/<uuid:trip_id>', views.TripDetailApiView.as_view(), name="trip_detail") ]