Example #1
0
from django.contrib import admin
from django.urls import path, include
from api import views
# from rest_framework_simplejwt.views import TokenObtainPairView ,TokenRefreshView
from rest_framework.routers import DefaultRouter
from api.auth import CustomAuthToken

#creating Router Object
router = DefaultRouter()

# Registering MovieViewset With Router
# router.register('movieapi', views.movieModelViewSet , basename='movie')

urlpatterns = [
    path('admin/', admin.site.urls),
    path('movieapi/', views.movieList.as_view()),
    path('collectiondatadelete/', views.collection_api),
    path('collectionapi/', views.collectionList.as_view()),
    path('', include((router.urls))),
    path('auth/', include('rest_framework.urls', namespace='rest_framework')),
    path('register/', CustomAuthToken.as_view()),
    # path('refreshtoken/',TokenRefreshView.as_view(), name='token_refresh_pair'),
]
Example #2
0
from django.contrib import admin
from django.urls import path, include
from api import views
from rest_framework.routers import DefaultRouter
from api.auth import CustomAuthToken

router = DefaultRouter()

router.register('studentapi', views.StudentModelViewSet, basename='student')

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/', include(router.urls)),
    path('auth/', include('rest_framework.urls', namespace='rest_framework')),
    path('gettoken/', CustomAuthToken.as_view())
]
Example #3
0
from django.contrib import admin
from django.urls import path, include
from django.utils.translation import deactivate
from api import views  # type: ignore
from rest_framework.routers import DefaultRouter

# from rest_framework.authtoken.views import obtain_auth_token
from api.auth import CustomAuthToken  #type: ignore

# creating router router
router = DefaultRouter()

# Register StudentViewSet with router
router.register('studentapi', views.StudentModelViewSet, basename='student')

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include(router.urls)),
    path('auth/', include('rest_framework.urls', namespace='rest')
         ),  # for session authentication login prompt; a login tab appears. 
    path('gettoken/', CustomAuthToken.as_view()),  # for token get/create
]
Example #4
0
from django.conf.urls import url, include
from rest_framework import routers
from api.auth import CustomAuthToken
from api import views

router = routers.DefaultRouter()
router.register(r'portfolios', views.PortfolioViewSet, base_name='portfolio')
router.register(r'assets', views.AssetViewSet, base_name='asset')
router.register(r'users', views.UserViewSet, base_name='user')

app_name = 'api'
urlpatterns = [
    url(r'^authenticate/', CustomAuthToken.as_view()),
    url(r'^settings/', views.RetrieveSettings.as_view()),
    url(r'^assets/', views.ListAssets.as_view()),
    url(r'^connected_exchanges/',
        views.ListCreateDestroyConnectedExchanges.as_view()),
    url(r'^connected_addresses/',
        views.ListCreateDestroyConnectedAddresses.as_view()),
    url(r'^exchanges/', views.RetrieveExchanges.as_view()),
    url(r'^', include(router.urls, namespace='api'))
]
    # for class based auth
    path('authapi', include(authapirouter.urls)),

    # for class based session
    path('sessionapi', include(sessionapirouter.urls)),
    path('auth/', include('rest_framework.urls', namespace='rest_framework')),

    # for function based authentication permission
    path('fpermission/', views.studentb_api_permission),
    path('fpermission/<int:pk>', views.studentb_api_permission),

    # for obtain auth token
    path('gettoken/', obtain_auth_token),

    # for obtain auth token custom response
    path('customtoken/', CustomAuthToken.as_view()),

    # for simple jwt token
    path('jwtapitoken/', TokenObtainPairView.as_view(), name = 'jwttoken'),
    path('jwtrefreshtoken/', TokenRefreshView.as_view(), name = 'jwttoken_refresh'),
    path('jwtverifytoken/', TokenVerifyView.as_view(), name = 'jwttoken_verify'),

    # for filtering
    path('filterstu/', views.StuL.as_view(), name= 'filtr'),

    # for Rest Serializer Relation
    path('relation/', include(realtion_router.urls)),

    # for Hyperlink model Serializer
    path('hyper/', include(hyper_router.urls)),