예제 #1
0
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'),
]
예제 #2
0
from django.urls import path
from rest_framework_simplejwt.views import TokenRefreshView
from django.contrib.auth.models import User
from .views import RegistrationView, ChangePasswordView, ConfirmationView, TokenObtainPairLoginCaseInsensitiveView

app_name = 'user'
urlpatterns = [
    path('token/obtain',
         TokenObtainPairLoginCaseInsensitiveView.as_view(),
         name='obtain_token'),
    path('token/refresh', TokenRefreshView.as_view(), name='refresh_token'),
    path('register', RegistrationView.as_view(), name='register'),
    path('password/change',
         ChangePasswordView.as_view(),
         name='change_password'),
    path('confirm/<user_id>/<token>',
         ConfirmationView.as_view(),
         name='confirm'),
]
예제 #3
0
from rest_framework import routers

from rest_framework_simplejwt.views import (TokenObtainPairView,
                                            TokenRefreshView, TokenVerifyView)

from apps.users.views import UserProfileAPIView

router = routers.DefaultRouter()

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/profile/', UserProfileAPIView.as_view(), name='user_profile'),
    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'),
    path('api/', include(router.urls)),
] + 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 += [
        path(
            "400/",
            default_views.bad_request,
            kwargs={"exception": Exception("Bad Request!")},
        ),
        path(
예제 #4
0
from django.conf.urls import url

# Third-party imports.
from rest_framework_simplejwt.views import (TokenObtainPairView,
                                            TokenRefreshView)

# Local imports.
from .apis import (ClientToken, OfferView, OfferByOrganizationView, OrderView,
                   OrganizationView, OrganizationDetailView, SignUpView)

__author__ = 'Jason Parent'

urlpatterns = [
    url(r'^sign_up/$', SignUpView.as_view(), name='sign_up'),
    url(r'^token/$', TokenObtainPairView.as_view(), name='token_obtain_pair'),
    url(r'^token/refresh/$', TokenRefreshView.as_view(), name='token_refresh'),
    url(r'^client_token/$', ClientToken.as_view(), name='client_token'),
    url(r'^organization/(?P<organization_id>\d+)/offer/$',
        OfferByOrganizationView.as_view({'get': 'list'}),
        name='offer_by_organization'),
    url(r'^organization/(?P<organization_id>\d+)/$',
        OrganizationDetailView.as_view(),
        name='organization_detail'),
    url(r'^organization/$',
        OrganizationView.as_view(),
        name='organization_list'),
    url(r'^offer/(?P<offer_id>[^/]+)/$',
        OfferView.as_view({'get': 'retrieve'}),
        name='offer_detail'),
    url(r'^offer/$', OfferView.as_view({'get': 'list'}), name='offer_list'),
    # url(r'^order/(?P<order_id>[^/]+)/$', OrderView.as_view(), name='order_detail'),
예제 #5
0
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from rest_framework_simplejwt.views import (
    TokenObtainPairView,
    TokenRefreshView,
)
from flights import views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('flights/', views.FlightsList.as_view(), name="flights-list"),
    path('bookings/', views.BookingsList.as_view(), name="bookings-list"),
    path('booking/<int:booking_id>/',
         views.BookingDetails.as_view(),
         name="booking-details"),
    path('booking/<int:booking_id>/update/',
         views.UpdateBooking.as_view(),
         name="update-booking"),
    path('booking/<int:booking_id>/cancel/',
         views.CancelBooking.as_view(),
         name="cancel-booking"),
    path('book/<int:flight_id>/',
         views.BookFlight.as_view(),
         name="book-flight"),
    path('login/', TokenObtainPairView.as_view(), name="login"),
    path('token/refresh/', TokenRefreshView.as_view(), name="token-refresh"),
    path('register/', views.Register.as_view(), name='register'),
]
예제 #6
0
from django.urls import path, include
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView, TokenVerifyView
from app.views import *
urlpatterns = [
    path('api/register', Register.as_view(), name='register'),
    path('api/login', TokenObtainPairView.as_view(), name='token_obtain_pair'),
    path('api/login/refresh', TokenRefreshView.as_view(),
         name='token_refresh'),
    path('api/login/verify', TokenVerifyView.as_view(), name='token_verify'),
    path('api/auth/datasets', Dataset.as_view(), name='datasets'),
]
예제 #7
0
파일: urls.py 프로젝트: garage-team/kinotab
"""kinotab 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 include, re_path
from rest_framework_simplejwt.views import TokenRefreshView

from profiles.views import TokenObtainPairView

urlpatterns = [
    re_path(r'^api/', include('profiles.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'),
    re_path(r'^admin/', admin.site.urls),
]
예제 #8
0
from django.conf.urls import url
from users.views import UserRegisterView, LoginView, UserDetailsView, PasswordResetView, PasswordResetConfimView
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView

urlpatterns = [
    url(r'signup/', UserRegisterView.as_view(), name='register'),
    url(r'login/', LoginView.as_view(), name='login'),
    url(r'^refresh_token/', TokenRefreshView.as_view(), name='token_refresh'),
    url(r'^passwordReset/', PasswordResetView.as_view(), name='pasword_reset'),
    url(r'^passwordResetConfirm/',
        PasswordResetConfimView.as_view(),
        name='pasword_reset_confirm'),
    url(r'^me/$', UserDetailsView.as_view(), name='user_details')
]
예제 #9
0
# -*- coding: utf-8 -*-

from django.urls import path
from rest_framework_simplejwt.views import TokenRefreshView
from ..views.auth import TokenObtainPairView


urlpatterns = [
    path('auth/token/', TokenObtainPairView.as_view(), name='auth.token_obtain_pair'),
    path('auth/token/refresh/', TokenRefreshView.as_view(), name='auth.token_refresh'),
]
예제 #10
0
from django.urls import path, include
from . import views
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView

from rest_framework import routers
router = routers.DefaultRouter()
router.register('ping', views.PingViewSet, basename="ping")

urlpatterns = [
    path('api/token/access/', TokenRefreshView.as_view(), name='token_get_access'),
    path('api/token/both/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
    path('api/', include(router.urls))
]

"""
- For the first view, you send the refresh token to get a new access token.
- For the second view, you send the client credentials (username and password)
  to get BOTH a new access and refresh token.
"""
예제 #11
0
router.register('video', VideoFrameView)
router.register('project', ProjectView)
router.register('object', ObjectTypeView)
router.register('classifier', ClassifierView)
router.register('offline_model', OfflineModelView)
router.register('file', FileUploadView)
router.register('crowdsource', CrowdsourceView)
router.register(r'object/(?P<object_id>.+)/contribution', ContributionView)

urlpatterns = [
    path('i18n/', include('django.conf.urls.i18n')),
    # API
    path('api/user/',
         include('rest_framework.urls')),  # REST_FRAMEWORK_URL_FOR_TEST
    path('api/auth/', TokenObtainPairView.as_view(), name='auth'),
    path('api/auth/refresh/', TokenRefreshView.as_view(), name='auth_refresh'),
    path('api/', include(router.urls)),
    path('api/ping/', test_view, name='test_view'),
    path('api/terminal/', terminal_view, name='terminal_view'),
    path('api/clean_temp/', clean_temp_view, name='clean_temp_view'),
    path('api/detail/classifier/',
         fetch_classifier_detail,
         name='fetch_classifier_detail'),  # Classifier Detail Fetch API
    path('api/detail/object_type/',
         fetch_object_type_detail,
         name='fetch_object_type_detail'),  # Object Type Detail Fetch API
    path('api/retrain/classifier/',
         retrain_classifier,
         name='retrain_classifier'),  # Re-Train Classifier
    path('api/kobo/', kobo, name='kobo'),  # Kobo Toolbox Webhook
    path('api/fulcrum/', fulcrum, name='fulcrum'),  # Fulcrum Webhook
예제 #12
0
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from django.urls import path, include
from rest_framework import routers
from rest_framework.authtoken.views import obtain_auth_token
from todo import views
from todo.auth import CustomAuthToken
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView, TokenVerifyView

router = routers.DefaultRouter()
router.register(r'todos', views.TodoView, 'todo')

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/', include(router.urls)),
    path("gettoken/", TokenObtainPairView.as_view(), name="token_pair"),
    path("refreshtoken/", TokenRefreshView.as_view(), name="refresh_token"),
    path("verifytoken/", TokenVerifyView.as_view(), name="verify_token")
]
예제 #13
0
"""ca_backend 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 TokenObtainPairView, TokenRefreshView, TokenVerifyView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('ca_arbitrage.urls')),
    path('api-auth/', include('rest_framework.urls')),
    path('auth/', include('djoser.urls')),
    path('api-token/', TokenObtainPairView.as_view()),
    path('api-token-refresh/', TokenRefreshView.as_view()),
    path('api-token-verify/', TokenVerifyView.as_view()),
]
예제 #14
0
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_swagger.views import get_swagger_view
from rest_framework_simplejwt.views import TokenRefreshView
from .customized_jwt import TokenObtainPairPatchedView

swagger = get_swagger_view(title='Guidez API')

urlpatterns = [
    path('admin/', admin.site.urls),
    path('accounts/login/', TokenObtainPairPatchedView.as_view()),
    path('accounts/refresh-token/', TokenRefreshView.as_view()),
    path('accounts/', include('accounts.urls')),
    path('blogs/', include('blog.urls')),
    path('order/', include('order.urls')),
    path('tours/', include('tours.urls')),
    path('api-auth/', include('rest_framework.urls')),
    path('summernote/', include('django_summernote.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

if settings.DEBUG:
    urlpatterns = urlpatterns + [
        path('', swagger),
    ]
from django.contrib import admin
from django.urls import path, include

from rest_framework import routers
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView

from medicalApp import views

router = routers.DefaultRouter()
router.register("company", views.CompanyViewSet, basename="company")

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"),
]
예제 #16
0
from django.urls import path

from rest_framework_simplejwt.views import TokenRefreshView
from .views import signup, login, getMessages, createRoom, getRooms, DeleteAccount, ChangePassword, joinRoom

# api endpoints

urlpatterns = [
    path('auth/signup/', signup),
    path('auth/login/', login.as_view()),
    path('auth/refreshToken/', TokenRefreshView.as_view()),
    path('messages-list/', getMessages),
    path('create-room/', createRoom),
    path('join-room/', joinRoom),
    path('get-rooms/', getRooms),
    path('delete-account/', DeleteAccount),
    path('change-password/', ChangePassword),
]
예제 #17
0
파일: urls.py 프로젝트: RunFeifei/Hilda
from django.urls import path
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView

from . import views
from .apiview import TestView, UserCreate

# 如果使用需要在setting文件打开默认token机制
# 默认的token机制 https://zhuanlan.zhihu.com/p/58426061
app_name = 'apis'
urlpatterns = [
    path('index', views.index),
    path('comments', views.comments),

    # 默认的token机制的注册和登录
    # path('register/', UserCreate.as_view(), name=UserCreate.name),
    # path('login/', LoginView.as_view(), name=LoginView.name),

    # 返回2个token:refresh access. 一个是刷新接口带的token 一个是其他接口带的token
    # https://zhuanlan.zhihu.com/p/139086573
    path('newregister/', UserCreate.as_view(), name=UserCreate.name),
    path('newlogin/', TokenObtainPairView.as_view(), name='login'),
    path('refreshtk/', TokenRefreshView.as_view(), name='refres_token'),
    path('test/', TestView.as_view(), name=TestView.name),
]
예제 #18
0
from django.urls import path
from . 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('',views.apiOverView, name = 'api-overview'),
    path('user-list/',views.UserList, name = 'user-list'),
    path('user-create/',views.UserCreate, name = 'user-create'),
    path('user-login/<str:user_Id>/<str:password>/',views.UserLogin, name = 'user-login'),
    path('user-blog-list/',views.UserBlogList, name = 'user-blog-list'),
    path('user-blog-create/',views.UserBlogCreate, name = 'user-blog-create'),
    path('user-Id/<str:username>/',views.UserId , name = 'User-Id'),
    path('user-blog-update/<str:user_Id>/',views.UserBlogUpdate , name = 'User-blog-update'),
    path('user-blog-delete/<str:user_Id>/',views.UserBlogDelete , name = 'User-blog-delete'),
    path('get-token/',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'),
] +static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
from django.urls import path
from rest_framework_simplejwt.views import TokenRefreshView

from .views import TokenObtainPairView

app_name = "public"
urlpatterns = [
    # Gets both access and refresh tokens
    path("api/token/", TokenObtainPairView.as_view(), name="token_obtain_pair"),
    # Send refresh token; receive new short-lived access token
    path("api/token/refresh/", TokenRefreshView.as_view(), name="token_refresh"),
]
예제 #20
0
"""donor_explorer URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.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.conf.urls import include
from django.contrib import admin
from django.urls import path
from rest_framework_simplejwt.views import (TokenObtainPairView,
                                            TokenRefreshView, TokenVerifyView)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/auth', include('rest_framework.urls',
                             namespace='rest_framework')),
    path('api/auth/token/obtain', TokenObtainPairView.as_view()),
    path('api/auth/token/refresh', TokenRefreshView.as_view()),
    path('api/auth/token/verify', TokenVerifyView.as_view()),
    path('api/donors/', include('donors.urls'))
]
예제 #21
0
from django.urls import include, path
from rest_framework import routers
from rest_framework_simplejwt.views import (TokenObtainPairView,
                                            TokenRefreshView)

from .views import RegisterView, GetUserView

router = routers.DefaultRouter()

urlpatterns = [
    path('login/', TokenObtainPairView.as_view()),
    path('login/refresh/', TokenRefreshView.as_view()),
    path('register/', RegisterView.as_view()),
    path('get_user/', GetUserView.as_view())
]
예제 #22
0
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 import routers
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView
from API import views
from rest_framework.authtoken import views as views2
router = routers.DefaultRouter()

router.register(r'posts', views.PostViewSets)
router.register(r'posts_2', views.PostViewSetsAlternate, basename="post_2")



urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include(router.urls)),
    path('api/auth/token', TokenObtainPairView.as_view(), name="auth_token"),
    path('api/auth/refresh', TokenRefreshView.as_view(), name="auth_refresh_token"),
    path('token_generate/', views2.obtain_auth_token)
]
예제 #23
0
router = DefaultRouter()
router.register(r'feedbacks', FeedbackViewSet, basename='api_feedback')
router.register(r'permissions', GroupViewSet, basename='api_permissions')
router.register(r'quizzes', MentorQuizViewSet, basename='api_quizzes')
router.register(r'questions', MentorQuestionViewSet, basename='api_questions')
router.register(r'answers', MentorAnswerViewSet, basename='api_answers')
router.register(r'country_indicator',
                CountryIndicatorViewSet,
                basename='api_country_indicator')

urlpatterns = [
    path(
        'token/',
        include([
            path('obtain/', TokenObtainPairView.as_view()),
            path('refresh/', TokenRefreshView.as_view()),
        ])),
    path('sign-up/', SignUpView.as_view()),
    path('profile/', ProfileView.as_view()),
    path('admin_page/', AdminListView.as_view()),
    path('admin_page/<int:pk>', BlockProfileView.as_view()),
    path('trainee/', include([
        path('quizzes/', TraineeQuizzesView.as_view()),
    ])),
    path('results/<int:pk>', ResultsGetView.as_view()),
    path('results', ResultsCreateView.as_view()),
]

urlpatterns += router.urls
예제 #24
0
    path(r'carreras/<str:codigo_carrera>/cantidad-cursantes/',
         CantidadCursantesView.as_view()),
    path(r'carreras/<str:codigo_carrera>/cantidad-cursantes/<int:anio>/',
         CantidadCursantesView.as_view()),
    path(r'carreras/<str:codigo_carrera>/cantidad-ingresantes/',
         CantidadIngresantesView.as_view()),
    path(r'carreras/<str:codigo_carrera>/cantidad-ingresantes/<int:anio>/',
         CantidadIngresantesView.as_view()),
    path(r'carreras/<str:codigo_carrera>/cantidad-postulantes/<int:anio>/',
         CantidadPostulantesView.as_view()),
    path(r'carreras/<str:codigo_carrera>/cantidad-postulantes/',
         CantidadPostulantesView.as_view()),
    path(r'alumno/<str:legajo>/cursadas/',
         AlumnoMateriasCursadasView.as_view()),
    path(r'alumno/<str:legajo>/inscripciones/',
         AlumnoInscripcionesView.as_view()),
    path(r'materia/<str:codigo>/alumnos/', MateriaAlumnosView.as_view()),
    path(r'api-auth/',
         include('rest_framework.urls', namespace='rest_framework')),
    path(r'v1/alumnos/', AlumnosAPIV1.as_view()),
    path(r'token/', AlumnosTokenObtainPairView.as_view(), name='token'),
    path(r'token/refresh/', TokenRefreshView.as_view()),
    path(r'materias/<str:subjectCode>/cursadas/', TakenSubjectsView.as_view()),
    path(r'materias/<str:subjectCode>/inscripciones/',
         SubjectInscriptionsView.as_view()),
    path(
        r'materias/<str:subjectCode>/inscripciones/<int:year>/<int:semester>/',
        SubjectInscriptionsView.as_view()),
    path(r'alumnos-en-carrera/', CareerStudentsView.as_view()),
    path(r'alumno/<str:studentNumber>', StudentView.as_view())
]
예제 #25
0
    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.routers import DefaultRouter
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView
from store_api.products.urls import urlpatterns as productPatterns


urlpatterns = [
    path('admin/', admin.site.urls),
    path('api-auth/', include('rest_framework.urls')),
    path('users/', include('store_api.users.urls')),
    path('posts/', include('store_api.posts.urls')),
    path('clients/', include('store_api.clients.urls')),
    path('orders/', include('store_api.orders.urls')),
    path('payments/', include('store_api.payments.urls')),
    path('api/token/', TokenObtainPairView.as_view()),
    path('api/token/refresh/', TokenRefreshView.as_view()),
    path('api/password_reset/', include('django_rest_passwordreset.urls', namespace='password_reset')),
] + productPatterns + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + \
    static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
예제 #26
0
파일: urls.py 프로젝트: chitra-b/formyapp
from django.urls import include, path, re_path
from rest_framework.routers import DefaultRouter
from rest_framework_simplejwt.views import (
    TokenObtainPairView,
    TokenRefreshView,
)
from rest_auth import views as auth_views

router = DefaultRouter()
router.register("user_profile",
                views.UserProfileViewSet,
                basename="user_profile")

urlpatterns = [
    path("login/", TokenObtainPairView.as_view(), name="token_obtain_pair"),
    path("logout/", views.UserLogoutAllView.as_view(), name="logout"),
    path("login/refresh/", TokenRefreshView.as_view(), name="token_refresh"),
    path(
        "rest-auth/password/reset/",
        auth_views.PasswordResetView.as_view(),
        name="password_reset",
    ),
    re_path(
        r"(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$",
        auth_views.PasswordResetConfirmView.as_view(),
        name="password_reset_confirm",
    ),
    # path("track_actions/", include("track_actions.urls")),
]
urlpatterns += router.urls
예제 #27
0
from django.urls import path, include
from rest_framework import routers
from django.conf import settings

from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView, TokenVerifyView

from userauth.urls import router as userAuthRouter
from timeline.urls import router as timelineRouter

if settings.DEBUG:
    router = routers.DefaultRouter()
else:
    router = routers.SimpleRouter()

router.registry.extend(userAuthRouter.registry)
router.registry.extend(timelineRouter.registry)

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('', include(router.urls)),
]
예제 #28
0
from django.urls import include, path
from rest_framework.routers import DefaultRouter
from rest_framework_simplejwt.views import (TokenObtainPairView,
                                            TokenRefreshView)

from .views import CommentViewSet, FollowViewSet, GroupViewSet, PostViewSet

v1_router = DefaultRouter()
v1_router.register('posts', PostViewSet, basename='Post')
v1_router.register(r'posts/(?P<post_id>\d+)/comments',
                   CommentViewSet,
                   basename='Comment')
v1_router.register('group', GroupViewSet, basename='Group')
v1_router.register('follow', FollowViewSet, basename='Follow')

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'),
]
예제 #29
0
import api.views as views
from django.urls import path, include
from rest_framework_simplejwt.views import (
    TokenObtainPairView,
    TokenVerifyView,
    TokenRefreshView
)

urlpatterns = [
    path('token/',
         TokenObtainPairView.as_view(), name='token_obtain_pair'),
    path('token/verify/',
         TokenVerifyView.as_view(), name='token_verify'),
    path('token/refresh/',
         TokenRefreshView.as_view(), name='token_refresh'),
    path('organizations/<uuid:orgId>/contacts/',
         views.ContactsView.as_view(), name='contacts'),
    path('organizations/<uuid:orgId>/contacts/<uuid:contactId>/',
         views.ContactView.as_view(), name='contact'),
    path('organizations/<uuid:orgId>/contacts/<uuid:contactId>/notes/',
         views.ContactNoteView.as_view(), name='contact_notes'),
    path('organizations/<uuid:orgId>/members/',
         views.MembersView.as_view(), name='members'),
    path('organizations/<uuid:orgId>/members/<uuid:memberId>/',
         views.MemberView.as_view(), name='member'),
    path('organizations/<uuid:orgId>/ranks/',
         views.RanksView.as_view(), name='ranks'),
    path('organizations/<uuid:orgId>/ranks/<uuid:rankId>/',
         views.RanksView.as_view(), name='rank'),
    path('organizations/<uuid:orgId>/requests/',
         views.RequestsView.as_view(), name='requests'),
예제 #30
0
from django.urls import path

from accounts import views

# app_name = 'users_api'
from rest_framework_simplejwt.views import TokenRefreshView
from accounts.views import MyObtainTokenPairView

urlpatterns = [
    path('api/user-list', views.UserListView.as_view()),
    path('api/user-activity', views.UserActivityListView.as_view()),
    path('api/jwt/login',
         MyObtainTokenPairView.as_view(),
         name='token_obtain_pair'),
    path('api/jwt/refresh', TokenRefreshView.as_view(), name='token_refresh'),
]
예제 #31
0
    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())
    ]





예제 #32
0
    path('api/visitors/create', views.VisitorsCreateView.as_view()),
    path('api/visitors/<visitor_id>', views.VisitorsDetailView.as_view()),
    path('api/visitors/<pk>/update', views.VisitorsUpdateView.as_view()),
    path('api/visitors/<pk>/waiver', views.VisitorsUpdateWaiverView.as_view()),
    path('api/checkins', views.CheckInsListView.as_view()),
    path('api/checkins/create', views.CheckInsCreateView.as_view()),
    path('api/checkins/<pk>', views.CheckInsDetailView.as_view()),
    path('api/checkins/<pk>/update', views.CheckInsUpdateView.as_view()),
    path('api/timesheets', views.TimesheetListView.as_view()),
    path('api/timesheets/create', views.TimesheetCreateView.as_view()),
    path('api/timesheets/<pk>', views.TimesheetDetailView.as_view()),
    path('api/visitreasons', views.VisitReasonListView.as_view()),
    path('api/visitreason/create', views.VisitReasonCreateView.as_view()),
    path('api/visitreason/<pk>', views.VisitReasonDetailView.as_view()),
    path('api/visitreason/<pk>/update', views.VisitReasonUpdateView.as_view()),
    path('api/visitreason/<pk>/delete',
         views.VisitReasonDestroyView.as_view()),
    path('api/checkinvisitreason', views.CheckInVisitReasonListView.as_view()),
    path('api/checkinvisitreason/create',
         views.CheckInVisitReasonCreateView.as_view()),
    path('api/checkinvisitreason/<pk>',
         views.CheckInVisitReasonDetailView.as_view()),
    path('api/login', MyTokenObtainPairView.as_view()),
    path('api/kioskmode', MyKioskTokenObtainPairView.as_view()),
    path('api/refresh', TokenRefreshView.as_view()),
    path('api/register', views.Registration.as_view()),
    path('api/password', views.ChangePassword.as_view()),
    path('api/sendInvite', views.SendInvite.as_view()),
    re_path(r'', views.index, name='index'),
]