def logout(request): send_logout_notification = request.user.is_authenticated() data = {'id': request.user.id, 'action': 'logout'} response = LogoutView.as_view()(request) if send_logout_notification: publish_data('notifications', data) return response
from core.views_auth import BluewhaleLoginView, get_user_info, send_verification_mail, \ verify_verification_token, \ register, userOperator from blog.views import ArticleListCreateView, ArticleDetailView from rest_framework import routers api_prefix = 'api/v1' router = routers.DefaultRouter() urlpatterns = [ # path('admin/', admin.site.urls), path(f'{api_prefix}/login', BluewhaleLoginView.as_view(), name='rest_login'), path(f'{api_prefix}/logout', LogoutView.as_view(), name='rest_logout'), path(f'{api_prefix}/send-verification', send_verification_mail, name='send verification mail'), path(f'{api_prefix}/verify/<token>', verify_verification_token, name='verify verification token'), path(f'{api_prefix}/register', register, name='register'), path(f'{api_prefix}/me', get_user_info, name='user profile'), path(f'{api_prefix}/articles', ArticleListCreateView.as_view(), name='articles'), path(f'{api_prefix}/articles/<pk>', ArticleDetailView.as_view(), name='article'), path(f'{api_prefix}/', include(router.urls)),
# Import the module somewhere, so it can register itself. import qabel_provider.monitoring rest_auth_register_urls = [ url(r'^$', views.PasswordPolicyRegisterView.as_view(), name='rest_register'), url(r'^verify-email/$', VerifyEmailView.as_view(), name='rest_verify_email'), ] rest_auth_urls = [ url(r'^password/reset/$', PasswordResetView.as_view(), name='rest_password_reset'), url(r'^password/reset/confirm/$', PasswordResetConfirmView.as_view(), name='rest_password_reset_confirm'), url(r'^login/$', views.ThrottledLoginView.as_view(), name='rest_login'), url(r'^logout/$', LogoutView.as_view(), name='rest_logout'), url(r'^user/$', UserDetailsView.as_view(), name='rest_user_details'), url(r'^password/change/$', PasswordChangeView.as_view(), name='rest_password_change'), ] rest_urls = [ url(r'^$', views.api_root, name='api-root'), url(r'^auth/', include(rest_auth_urls)), url(r'^auth/registration/', include(registration_urls)), url(r'^internal/user/$', views.auth_resource, name='api-auth'), url(r'^internal/user/register/$', views.register_on_behalf), url(r'^plan/subscription/$', views.plan_subscription), url(r'^plan/add-interval/$', views.plan_add_interval), ]
schema_view = get_schema_view( title="$PROJECT_NAME API", description="API for interacting with the $PROJECT_NAME application", version="1.0.0", public=True) def error_view(request): raise Exception('This is a test error to verify error reporting.') # Allow logging out when faced with the mysterious CSRF cookie corruption problem: class LogoutView(LogoutView): authentication_classes = [] urlpatterns = [ path('admin/', admin.site.urls), path('rest-auth/logout/', LogoutView.as_view()), path('rest-auth/', include('rest_auth.urls')), path('rest/error_test/', error_view, name='error-view'), path('openapi/', schema_view, name='openapi-schema'), path('swagger-ui/', TemplateView.as_view( template_name='swagger-ui.html', extra_context={'schema_url': 'openapi-schema'} ), name='swagger-ui') ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns = [ # Hikes path('hikes/', HikesListAPI.as_view(), name='hike_list_api'), path('hikes/<int:pk>/', HikeAPI.as_view(), name='hike_api'), path('hikes/<int:pk>/register', HikeRegisterFormAPI.as_view(), name='hike_register_api'), path('hikes/<int:pk>/unregister', HikeUnRegisterFormAPI.as_view(), name='hike_unregister_api'), path('hike-reqs/', HikeRequestsListAPI.as_view(), name='hike_requests_api'), path('hike-reqs/<int:pk>', HikeRequestAPI.as_view(), name='hike_request_api'), path('hike-reqs/register/', HikeRequestFormAPI.as_view(), name='hike_request_form_api'), # Accounts path('hikers/', HikersAPI.as_view(), name='hiker_list_api'), path('hikers/<int:pk>', HikerAPI.as_view(), name='hiker_api'), path('hikers/me/', CurrentUserAPI.as_view(), name='current_user_api'), # REST Auth path('auth-knox/', include('knox.urls')), path('auth/login/', HikerLoginAPI.as_view(), name='auth_login'), path('auth/logout/', LogoutView.as_view(), name='auth_logout'), path('auth/register/', HikerRegisterAPI.as_view(), name='auth_register') ]
# 4 endpoints for drf-yasg # 1. A JSON view of your API specification at /swagger.json # 2. A YAML view of your API specification at /swagger.yaml # 3. A swagger-ui view of your API specification at /swagger/ # 4. A ReDoc view of your API specification at /redoc/ # TODO: swagger integration with JWT based authentication # url(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'), # url(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), url(r'^redoc/v1/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'), # DO NOT INCLUDE WHOLE REST_AUTH ALL URLS. An error will happen. (1. ~ 3. belows, rest-auth issue?) # => django.core.exceptions.ImproperlyConfigured: Field name `username` is not valid for model `User`. url(r'^rest-auth/', include('rest_auth.urls')), url(r'^rest-auth/login/$', LoginView.as_view(), name='rest_login'), url(r'^rest-auth/logout/$', LogoutView.as_view(), name='rest_logout'), url(r'^rest-auth/registration/', include('rest_auth.registration.urls')), url(r'^rest-auth/login/google/', GoogleLogin.as_view(), name='google_login'), url(r'^rest-auth/login/kakao/', KakaoLogin.as_view(), name='kakao_login'), path('', include(router.urls)), path('admin/', admin.site.urls), path('study/', include('studies.urls')), path('tag/', include('tags.urls')), path('question/', include('questions.urls')), path('comment/', include('comments.urls')), path('indicator/', include('indicators.urls')), path('image/', include('images.urls')), url(r'^jwt-auth/$', obtain_jwt_token),
# All ############################## urlpatterns = [ # enable the admin interface url(r'^admin/', admin.site.urls), url(r'^stats/stacksampler', StackSamplerView.as_view()), url(r'^api/v3/auth/password/reset/confirm/$', PasswordResetConfirmView.as_view(), name='rest_password_reset_confirm'), url(r'^api/v3/auth/login/$', LoginView.as_view(), name='rest_login'), # URLs that require a user to be logged in with a valid session / token. url(r'^api/v3/auth/logout/$', LogoutView.as_view(), name='rest_logout'), url(r'^api/v3/auth/password/change/$', PasswordChangeView.as_view(), name='rest_password_change'), # Rest Auth requires auth urls. If we remove this, then we'll get an error # around NoReverseMatch # TODO: Work out how to avoid external access to these URLs if possible url(r'^', include('django.contrib.auth.urls')), url(r'^api/v3/', include('zconnect.urls')), url(r'^api/v3/', include('zconnect.zc_billing.urls')), url(r'^celerymqtttest/', CeleryMQTTTestViewSet.as_view({'post': 'create'})), # For django-db-file-storage: url(r'^files/', include('db_file_storage.urls')),
from django.urls import include, path from .views import RegistrationAPI, LoginAPI, UserAPI from rest_auth.views import LogoutView urlpatterns = [ path('auth/register/', RegistrationAPI.as_view()), path('auth/login/', LoginAPI.as_view()), path('auth/user/', UserAPI.as_view()), path('auth/logout/', LogoutView.as_view()), ]
from django.contrib import admin from django.urls import path, include from django.conf.urls import url from .views import LoginAPIView, EmailConfirmAPIView, VerifyEmailView from rest_auth.views import (LogoutView, PasswordChangeView, PasswordResetView, PasswordResetConfirmView) app_name = "authentication" urlpatterns = [ path('api/login/', LoginAPIView.as_view(), name='account_login'), path('api/logout/', LogoutView.as_view(), name='account_logout'), path('api/u/change_password', PasswordChangeView.as_view(), name='password_change_view'), path('api/u/reset_passowrd', PasswordResetView.as_view(), name='password_reset_view'), path('api/u/reset_confirm', PasswordResetConfirmView.as_view(), name='password_reset_confirm_view'), path('api/u/verify_email', VerifyEmailView.as_view(), name='account_verify'), url('confirm_email/(?P<key>[-:\w]+)/$', EmailConfirmAPIView.as_view(), name='account_confirm_email') ]
routes = getattr(settings, 'REACT_ROUTES', []) urlpatterns = [ # path('admin/', admin.site.urls), #REACT로 만든 index.html 게시글 접근 # path('', TemplateView.as_view(template_name='index.html'),name='index'), #REACT ROUTER 역할 처럼 다시 들어올수 있도록 설정하기 url(r'^(%s)?$' % '|'.join(routes), TemplateView.as_view(template_name="index.html"),name='index'), path('', include('board.urls')), path('accounts/', include('accounts.urls')), # path('api/token/', obtain_jwt_token), # path('api/token/verify/', verify_jwt_token), # path('api/token/refresh/', refresh_jwt_token), # path('api-auth/', include('rest_framework.urls')), #로그인 # path("rest-auth/", include('rest_auth.urls')), path('rest-auth/login', LoginView.as_view(), name='rest_login'), path('rest-auth/logout', LogoutView.as_view(), name='rest_logout'), path('rest-auth/user', UserDetailsView.as_view(), name='rest_user_details'), path('rest-auth/password/change', PasswordChangeView.as_view(), name='rest_password_change'), #회원가입 path("rest-auth/registration", include('rest_auth.registration.urls')), ] urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.conf.urls import patterns, url from rest_auth.views import ( LoginView, LogoutView, UserDetailsView, PasswordChangeView, PasswordResetView, PasswordResetConfirmView, ) urlpatterns = patterns( "", # URLs that do not require a session or valid token url(r"^password/reset", PasswordResetView.as_view(), name="rest_password_reset"), url(r"^confirm/password/reset", PasswordResetConfirmView.as_view()), # url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', 'django.contrib.auth.views.password_reset_confirm', name='password_reset_confirm'), url( r"^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$", PasswordResetConfirmView.as_view(), name="password_reset_confirm", ), url(r"^login", LoginView.as_view(), name="rest_login"), # URLs that require a user to be logged in with a valid session / token. url(r"^logout", LogoutView.as_view(), name="rest_logout"), url(r"^user/$", UserDetailsView.as_view(), name="rest_user_details"), url(r"^password/change", PasswordChangeView.as_view(), name="rest_password_change"), )
class PasswordResetConfirmViewSchema(CustomAutoSchema): request_serializer = PasswordResetConfirmSerializer() response_serializer = RestAuthCommonResponseSerializer() class PasswordChangeViewSchema(CustomAutoSchema): request_serializer = PasswordChangeSerializer() response_serializer = RestAuthCommonResponseSerializer() urlpatterns = [ url(r'^login/$', LoginView.as_view(schema=LoginViewSchema()), name='rest_login'), url(r'^logout/$', LogoutView.as_view(schema=LogoutViewSchema()), name='rest_logout'), url(r'^password/reset/$', PasswordResetView.as_view(schema=PasswordResetViewSchema()), name='rest_password_reset'), url(r'^password/reset/confirm/$', PasswordResetConfirmView.as_view( schema=PasswordResetConfirmViewSchema()), name='rest_password_reset_confirm'), url(r'^password/change/$', PasswordChangeView.as_view(schema=PasswordChangeViewSchema()), name='rest_password_change'), ]
from django.urls import path from rest_auth.views import LoginView, LogoutView from rest_framework.routers import DefaultRouter from .views import UserViewSet, CheckAuthView router = DefaultRouter() router.register('users', UserViewSet) urlpatterns = [ path('users/login/', LoginView.as_view()), path('users/logout/', LogoutView.as_view()), path('users/check-auth/', CheckAuthView().as_view()) ] urlpatterns += router.urls
from django.urls import include from django.conf.urls import url from rest_auth.views import LogoutView from account.views import LoginAPIView urlpatterns = [ url(r'^login/?', LoginAPIView.as_view()), url(r'^logout/?', LogoutView.as_view()), url(r'^accounts/', include('account.urls')), url(r'^backups/', include('backup.urls')) ]
from django.urls import path, include from cognitev_app.views import RegisterAPIView from . import views from django.views.generic import TemplateView from rest_auth.views import ( LoginView, PasswordResetView, PasswordResetConfirmView, PasswordChangeView, LogoutView ) from rest_auth.registration.views import RegisterView, VerifyEmailView urlpatterns = [ path('', include('rest_auth.urls')), path('registration/',RegisterAPIView.as_view(), name='account_signup'), path('registration/', include('rest_auth.registration.urls')), path('login/', LoginView.as_view(), name='account_login'), path('logout/', LogoutView.as_view(), name='rest_logout'), #path('password/reset/', PasswordResetView.as_view(), name='rest_password_reset'), #path('password/reset/confirm/<str:uidb64>/<str:token>/', #PasswordResetConfirmView.as_view(), #name='rest_password_reset_confirm'), #path('password/change/', PasswordChangeView.as_view(), name='rest_password_change'), path('profile/<int:pk>/', views.ProfileAPIView.as_view()), path('user/<str:username>/', views.UserDetailView.as_view()), ]
from django.conf.urls import url from rest_auth.registration.views import VerifyEmailView from rest_auth.views import LoginView, LogoutView, PasswordResetConfirmView, PasswordChangeView from rest_framework.routers import DefaultRouter from per_auth import views from per_auth.views import CustomizedPasswordResetView, CustomizedRegisterView, PersonViewSet # app_name = 'per_auth' router = DefaultRouter() router.register(r'person', PersonViewSet, base_name='person') urlpatterns = router.urls + [ url(r'^login/?$', LoginView.as_view(), name='login'), url(r'^register/?$', CustomizedRegisterView.as_view(), name='register'), url(r'^logout/?$', LogoutView.as_view(), name='logout'), url(r'^verify-email/$', VerifyEmailView.as_view(), name='rest_verify_email'), url(r'^account-confirm-email/(?P<key>[-:\w]+)/$', confirm_email, name='account_confirm_email'), url(r'^activate/?$', views.activate, name='activate'), url(r'^password/forgot/?$', CustomizedPasswordResetView.as_view(), name='forgot_password'), url(r'^password/reset/?$', PasswordResetConfirmView.as_view(), name='reset_password'), url(r'^password/change/?$', PasswordChangeView.as_view(),
return HttpResponse('') urlpatterns = [ # Inbuilt Endpoints path('admin/', admin.site.urls), # Rest Auth Endpoints path('authentication/password/reset/', PasswordResetView.as_view(), name='rest_password_reset'), path('authentication/password/reset/confirm/', PasswordResetConfirmView.as_view(), name='rest_password_reset_confirm'), path('authentication/login/', LoginView.as_view(), name='rest_login'), path('authentication/logout/', LogoutView.as_view(), name='rest_logout'), path('authentication/password/change/', PasswordChangeView.as_view(), name='rest_password_change'), # The following URL actually has no functionality. When sending an email to a user regarding their requested # password change, we need a url with the name 'password_reset_confirm' so that we can use it as a template to # create the actual URL that the user should be redirected to. This actual URL needs to point to the frontend, # not back to the Django backend. This pointing is done based on the 'Domain Name' you provide in the 'sites' # table. You can set the domain name by going to the admin panel and looking for the sites. Please refer to the # rest-auth documentation for more details. path('password-reset/<uidb64>/<token>/', empty_view, name='password_reset_confirm'), # Rest Auth Registration Endpoints
"""server 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.conf.urls import url from django.urls import include from rest_auth.views import (LogoutView, UserDetailsView) from server.trees.views import TreeView, TreeListView, TreeCreateView, TreeDestroyView urlpatterns = { url(r'^api/', include(('timed_auth_token.urls', 'timed_auth_token'), namespace='auth'), name='login'), url(r'^api/logout/$', LogoutView.as_view(), name='logout'), url(r'^api/user/$', UserDetailsView.as_view(), name='user_details'), url(r'^api/tree/(?P<pk>\d+)$', TreeView.as_view(), name='tree_detail'), url(r'^api/tree/(?P<pk>\d+)/del$', TreeDestroyView.as_view(), name='tree_delete'), url(r'^api/trees/$', TreeListView.as_view(), name='tree_list'), url(r'^api/tree/$', TreeCreateView.as_view(), name='tree_save'), }
from django.conf import settings from django.conf.urls.static import static from rest_framework.documentation import include_docs_urls from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView from rest_framework import routers from rest_auth.registration.views import VerifyEmailView, RegisterView router = routers.DefaultRouter() urlpatterns = [ path( 'my/', include('djstripe.contrib.rest_framework.urls', namespace="rest_djstripe")), path("stripe/", include("djstripe.urls", namespace="djstripe")), path('logout', LogoutView.as_view(), name='user-logout'), path('password/change/', PasswordChangeView.as_view(), name='rest_password_change'), path('password/reset', PasswordResetView.as_view(), name='rest_password_reset'), path('password/reset/confirm/', PasswordResetConfirmView.as_view(), name='rest_password_reset_confirm'), path('api/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('api/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'), path('admin/', admin.site.urls),
'Username/Password is required.' })(LoginView.as_view()) logout_view = swagger_auto_schema( operation_summary='Logout authenticated user', operation_description=''' Logout an authenticated user by deleting the Token object assigned to the current User object. **Note:** It accepts/returns nothing. ''', operation_id='user-logout', methods=['GET', 'POST'], tags=['User Accounts'], responses={status.HTTP_200_OK: 'Successfully logged out.'})(LogoutView.as_view()) password_change_view = swagger_auto_schema( operation_summary='Change user password', operation_description=''' This endpoint changes the password of the current authenticated user. ''', operation_id='password-change', methods=['POST'], tags=['User Accounts'], responses={ status.HTTP_200_OK: 'Password changed successfully.', status.HTTP_400_BAD_REQUEST: 'Password validation errors.', status.HTTP_401_UNAUTHORIZED: 'Unauthorized request.', })(PasswordChangeView.as_view())
from django.urls import path from rest_auth.views import LogoutView from .views import Login from django.views.decorators.csrf import csrf_exempt urlpatterns = [ path('login/', csrf_exempt(Login.as_view())), path('logout/', csrf_exempt(LogoutView.as_view())), ]
path('tables/<int:pk>', index, name='index'), path('card/<uuid:pk>', index, name='index'), path('admin/', admin.site.urls), path('api/tables/', TableList.as_view()), path('api/tables/<int:pk>', TableDetail.as_view()), path('api/lists/', ListaList.as_view()), path('api/lists/<int:pk>', ListaDetail.as_view()), path('api/cards/', CardList.as_view()), path('api/cards/<uuid:pk>', CardDetail.as_view()), path('api/attachments/', AttachmentList.as_view()), path('api/attachments/<int:pk>', AttachmentDetail.as_view()), path('api/cards/attachments/<uuid:pk>', CardsAttachmentList.as_view()), path('api/cards/comments/<uuid:pk>', CardsCommentsList.as_view()), path('api/comments/<int:pk>', CommentDetail.as_view()), path('api/comments/', CommentAdd.as_view()), path('api/activities/', ActivityCreate.as_view()), path('api/activities/<int:pk>', ActivityDetail.as_view()), path('api/cards/activities/<uuid:pk>', CardsActivitiesList.as_view()), path('api/cards/all_activities/<uuid:pk>', CardAllActivitiesList.as_view()), path('api/labels', LabelCreate.as_view()), path('api/labels/<int:pk>', LabelDetail.as_view()), path('api/tables/labels/<int:pk>', LabelsOfTable.as_view()), path('api/o/', include('oauth2_provider.urls', namespace='oauth2_provider')), path('api/users/create', CreateUserView.as_view()), path('api/login/', LoginView.as_view(), name='login'), path('api/logout/', LogoutView.as_view(), name='logout'), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns = format_suffix_patterns(urlpatterns)
#router.register(r'customers', CustomersViewSet.as_view) # Wire up our API using automatic URL routing. # Additionally, we include login URLs for the browsable API. #http://django-rest-auth.readthedocs.io/en/latest/api_endpoints.html urlpatterns = [ url(r'^$', home, name='home'), url(r'^about/$', 'business.views.about', name='about'), url(r'^admin/', include(admin.site.urls)), url(r'^business/', include('business.urls')), url(r'^products/', include('product.urls')), url(r'^cart/', include('cart.urls')), url(r'^api/$', APIHomeView.as_view()), url(r'^account/', include('customers.urls')), url(r'^login/$', MyLoginView.as_view(), name='account_login'), url(r'^logout/$', LogoutView.as_view(), name='user_logout'), url(r'^password/reset/$', PasswordResetView.as_view(), name='user_password_reset'), url(r'^password/change/$', PasswordChangeView.as_view(), name='user_password_change'), ] ''' if settings.SERVE_MEDIA: urlpatterns += patterns("", (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True }), ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.urls import path, include from .views import UserCreate, Loginview, Logout from rest_auth.views import LogoutView urlpatterns = [ path("signup/", UserCreate.as_view(), name="user_create"), path("login/",Loginview.as_view(),name="login_view"), path("logout/",LogoutView.as_view(),name="login_view"), ]
from django.urls import path from users.views import CreateUserAPIView, RetrieveUsernameAndColorAPIView from rest_auth.views import LoginView from rest_auth.views import LogoutView app_name = 'users' urlpatterns = [ path("create/", CreateUserAPIView.as_view(), name="user-create"), path("login/", LoginView.as_view(), name="user-login"), path("logout/", LogoutView.as_view(), name="user-logout"), path("me/", RetrieveUsernameAndColorAPIView.as_view(), name='user-me') ]
from django.urls import path from rest_auth.views import LogoutView from .api import ULoginView, UserCreate, UserView, SchoolClassList, LessonList urlpatterns = [ path('api/login', ULoginView.as_view()), path('api/logout', LogoutView.as_view()), path('api/register', UserCreate.as_view()), path('api/user', UserView.as_view()), path('api/school_classes', SchoolClassList.as_view()), path('api/lessons/<subject_id>', LessonList.as_view()), ]
path( "password/change/", views.UserPasswordChangeView.as_view(), name="rest_password_change", ), path( "password/reset/", views.UserPasswordResetView.as_view(), name="rest_password_reset", ), path("", include("rest_auth.urls")), path("registration/", views.UserRegisterView.as_view(), name="account_signup"), path("rest-auth/registration/", include("rest_auth.registration.urls")), path( "account-confirm-email/<str:key>/", views.VerifyUserEmailView.as_view(), name="account_confirm_email", ), path( "password/reset/confirm/<str:uid>/<str:token>/", views.UserPasswordResetConfirmView.as_view(), name="rest_password_reset_confirm", ), path("resend/confirmation/", views.ResendEmailConfirmation.as_view(), name="resend_confirmation"), path("logout/", LogoutView.as_view(), name="rest_logout"), ]
from django.urls import path, include from rest_framework import routers from . import views from rest_auth.views import (LogoutView, UserDetailsView, PasswordChangeView, PasswordResetView, PasswordResetConfirmView) urlpatterns = [ path('login', views.LoginView.as_view(), name='login-url'), path('google_login', views.GoogleLoginView.as_view()), path('password/reset', PasswordResetView.as_view()), path('password/reset/confirm', PasswordResetConfirmView.as_view()), path('logout', LogoutView.as_view()), path('user', UserDetailsView.as_view()), path('password/change', PasswordChangeView.as_view()), ]
from django.conf.urls import url from django.contrib import admin from django.urls import include from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token, verify_jwt_token from rest_auth.views import LoginView, LogoutView from login.views import UserRegistration app_name = "login" urlpatterns = [ url(r'^register/$', UserRegistration.as_view(), name="register"), url(r'^login/$', LoginView.as_view(), name="login"), url(r'^logout/$', LogoutView.as_view(), name="logout"), ]
from index.lecture_hall.views import LectureHallViewSet from index.lesson.views import LessonViewSet from index.teacher.views import TeacherViewSet from index.training_direction.views import TrainingDirectionViewSet from index.building.views import BuildingViewSet from index.flow.views import FlowViewSet from rest_auth.views import ( LoginView, LogoutView, PasswordChangeView, UserDetailsView, ) rest_auth_urls = [ url(r'^login/$', LoginView.as_view(), name='rest_login'), url(r'^logout/$', LogoutView.as_view(), name='rest_logout'), url(r'^password/change/$', PasswordChangeView.as_view(), name='rest_password_change'), url(r'^user/$', UserDetailsView.as_view(), name='user'), ] router = routers.DefaultRouter() router.register(r'discipline', DisciplineViewSet, basename='Discipline') router.register(r'education_plan', EducationPlanViewSet, basename='EducationPlan') router.register(r'group', GroupViewSet, basename='Group') router.register(r'lecture_hall', LectureHallViewSet, basename='LectureHall') router.register(r'lesson', LessonViewSet, basename='Lesson') router.register(r'teacher', TeacherViewSet, basename='Teacher')
rest.ProjectMessagesViewSet, base_name="messages") results_router = NestedDefaultRouter(projects_router, "series", lookup="series", trailing_slash=True) results_router.include_format_suffixes = False results_router.register("results", rest.SeriesResultsViewSet, base_name="results") schema_view = get_schema_view(title="API schema") urlpatterns = _build_urls() dispatch_module_hook("api_url_hook", urlpatterns=urlpatterns) urlpatterns += [ url( r"^v1/projects/by-name/(?P<name>[^/]*)(?P<tail>/.*|$)", rest.ProjectsByNameView.as_view(), ), url(r"^v1/users/login/$", LoginView.as_view(), name="rest_login"), url(r"^v1/users/logout/$", LogoutView.as_view(), name="rest_logout"), url(r"^v1/", include(router.urls)), url(r"^v1/", include(projects_router.urls)), url(r"^v1/", include(results_router.urls)), url(r"^v1/schema/$", schema_view), # Use the base class's handler by default url(r".*", views.APIView.as_view()), ]
path('api-auth/', include('rest_framework.urls', namespace='rest_framework')) ] # URL for rest-auth urlpatterns += [ # URLs that do not require a session or valid token re_path(r'^rest-auth/password/reset/$', PasswordResetView.as_view(), name='rest_password_reset'), re_path(r'^rest-auth/password/reset/confirm/$', PasswordResetConfirmView.as_view(), name='rest_password_reset_confirm'), re_path(r'^rest-auth/login/$', LoginView.as_view(), name='rest_login'), # URLs that require a user to be logged in with a valid session / token. re_path(r'^rest-auth/logout/$', LogoutView.as_view(), name='rest_logout'), re_path(r'^rest-auth/user/$', UserDetailsView.as_view(), name='rest_user_details'), re_path(r'^rest-auth/password/change/$', PasswordChangeView.as_view(), name='rest_password_change'), ] if settings.DEBUG: urlpatterns += [ path('admin/', admin.site.urls), ] # Add final wildcard route to catch the deep links
MyTokenRefreshView, MyTokenVerifyView, UserAccountDataView, UserApiView, UserRegistrationView, ) urlpatterns = [ path("", UserRegistrationView.as_view(), name=USER_REGISTRATION_URL_NAME), path("api/token/refresh/", MyTokenRefreshView.as_view(), name=TOKEN_REFRESH_URL_NAME), path("api/token/verify/", MyTokenVerifyView.as_view(), name=TOKEN_VERIFY_URL_NAME), path("logout/", LogoutView.as_view(), name=LOGOUT_URL_NAME), path("password/change/", PasswordChangeView.as_view(), name=CHANGE_PASS_URL_NAME), path("password/reset/", PasswordResetView.as_view(), name=PASS_RESET_URL_NAME), path( "password/reset/confirm/", PasswordResetConfirmView.as_view(), name=PASS_RESET_CONFIRM_URL_NAME, ), path( "me/", UserApiView.as_view({ "get": "retrieve",