) urlpatterns = [ # URLs that do not require a session or valid token path('password/reset/', PasswordResetView.as_view(), name='rest_password_reset'), path('password/reset/confirm/', PasswordResetConfirmView.as_view(), name='rest_password_reset_confirm'), path('login/', LoginView.as_view(), name='rest_login'), # URLs that require a user to be logged in with a valid session / token. path('logout/', LogoutView.as_view(), name='rest_logout'), path('user/', UserDetailsView.as_view(), name='rest_user_details'), path('password/change/', PasswordChangeView.as_view(), name='rest_password_change'), ] if getattr(settings, 'REST_USE_JWT', False): from rest_framework_simplejwt.views import TokenVerifyView from dj_rest_auth.jwt_auth import get_refresh_view urlpatterns += [ path('token/verify/', TokenVerifyView.as_view(), name='token_verify'), path('token/refresh/', get_refresh_view().as_view(), name='token_refresh'), ]
router.register(r'records', RecordViewSet, basename='Record') timeline_list = TimelineViewSet.as_view({'get': 'list', 'post': 'create'}) timeline_detail = TimelineViewSet.as_view({ 'get': 'retrieve', 'put': 'update', 'patch': 'partial_update', 'delete': 'destroy' }) urlpatterns = dj_urlpatterns + [ path('auth/google/', GoogleLogin.as_view(), name='google_login'), path('logout/', Logout.as_view(), name='rest_logout'), path('timelines/', timeline_list, name='timeline-list'), path('timelines/<int:pk>/', timeline_detail, name='timeline-detail'), path('token/refresh/', get_refresh_view().as_view(), name='token_refresh'), # re_path(r'^accounts/', include('allauth.urls'), name='socialaccount_signup'), # API Ressources URLs path('', include(router.urls)), # API swagger/redoc access re_path(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'), re_path(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), re_path(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'), ]