from django.conf.urls import url, include from authentication.views import RegistrationAPIView, LoginAPIView, UserListViewSet urlpatterns = [ url(r'^users/$', UserListViewSet.as_view({'get': 'list'}), name='user_list'), url(r'^users/register/$', RegistrationAPIView.as_view(), name='register'), url(r'^users/login/$', LoginAPIView.as_view(), name='login'), ]
from django.urls import path from rest_framework import routers from authentication.views import ( RegistrationAPIView, Activate, LoginAPIView, Reset, ) app_name ="authentication" urlpatterns = [ path("users/", RegistrationAPIView.as_view(), name="register"), path('activate/<uidb64>/<token>/', Activate.as_view(), name="activate"), path('users/login', LoginAPIView.as_view()), path("users/reset/<uidb64>/<token>", Reset.as_view(), name="reset") ]
from django.urls import path, include from authentication.views import RegistrationAPIView, LoginAPIView app_name = "authentication" urlpatterns = [ path("register/", RegistrationAPIView.as_view(), name="register"), path("login/", LoginAPIView.as_view(), name="login"), ]
from django.contrib import admin from django.urls import path from django.conf.urls import url from authentication.views import (RegisterationAPIView, LoginAPIView, UserRetreiveUpdateView, SocialLoginRegisterationAPIView) app_name = 'authentication' urlpatterns = [ url(r'^users/?$', RegisterationAPIView.as_view()), url(r'^users/login/?$', LoginAPIView.as_view()), url(r'^socialusers/login/?$', SocialLoginRegisterationAPIView.as_view()), url(r'^user', UserRetreiveUpdateView.as_view()), ]
from django.urls import path from authentication.views import RegisterView, VerifyEmail, LoginAPIView from rest_framework_simplejwt.views import ( TokenRefreshView, ) urlpatterns = [ path('register/', RegisterView.as_view(), name="register"), path('login/', LoginAPIView.as_view(), name="login"), path('email-verify/', VerifyEmail.as_view(), name="email-verify"), path('token/refresh/', TokenRefreshView.as_view(), name='token_refresh'), ]
from django.urls import path from authentication.views import RegisterView, VerifyEmail, LoginAPIView, ResetPassword, NewPassword, LogoutView, UserProfileView urlpatterns = [ path('register/', RegisterView.as_view(), name='register'), path('user-profile/', UserProfileView.as_view(), name='user-profile'), path('login/', LoginAPIView.as_view(), name='login'), path('logout/', LogoutView.as_view(), name='logout'), path('verify-email/', VerifyEmail.as_view(), name='verify-email'), path('reset-password/', ResetPassword.as_view(), name='reset-password'), path('new-pass/', NewPassword.as_view(), name='new-pass'), ]
from django.urls import path from authentication.views import RegisterAPIView, LoginAPIView urlpatterns = [ path('registration', RegisterAPIView.as_view()), path('login', LoginAPIView.as_view()), ]
from django.conf.urls import url from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token, verify_jwt_token from authentication.views import LoginAPIView, RegistrationAPIView, UserRetrieveUpdateAPIView urlpatterns = [ url(r'^get-token/', obtain_jwt_token), #login users to get token url(r'^token-refresh/', refresh_jwt_token), url(r'^token-verify/', verify_jwt_token), ###### url(r'^user/?$', UserRetrieveUpdateAPIView.as_view()), url(r'^user/register/?$', RegistrationAPIView.as_view()), url(r'^user/login/?$', LoginAPIView.as_view()), #this may not be important ]
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, re_path from authentication.views import RegistrationAPIView, LoginAPIView from news.views import News, Comments, Upvotes urlpatterns = [ path('admin/', admin.site.urls), re_path(r'^registration/?$', RegistrationAPIView.as_view(), name='user_registration'), re_path(r'^login/?$', LoginAPIView.as_view(), name='user_login'), re_path(r'^news/?$', News.as_view(), name='news'), re_path(r'^upvote/?$', Upvotes.as_view(), name='upvote'), re_path(r'^comment/?$', Comments.as_view(), name='comment'), ]