from django.contrib import admin from django.urls import path from user.views import UserView, UserAllView urlpatterns = [ path('<int:id>', UserView.as_view()), path('', UserAllView.as_view()) ]
from django.urls import path from user.views import UserView, SigninView urlpatterns = [ path('/sign-up', UserView.as_view(), name='sign-up'), path('/sign-in', SigninView.as_view(), name='sign-in'), ]
from django.urls import path from user.views import UserView urlpatterns = [ path('', UserView.as_view(), name='user') ]
from django.urls import path from user.views import UserView urlpatterns = [ path('/users', UserView.as_view()) ]
from django.urls import path, include from rest_framework.authtoken.views import obtain_auth_token # router = routers.DefaultRouter() # router.register('register', registration_view) from user.views import UserView, UserRegistrationView, PendingUserApplication, ApproveUserApplicationView, \ CurrentUserView, UserUpdateView, VendorUpdateView urlpatterns = [ path('register', UserRegistrationView.as_view(), name='register'), path('vregister', VendorUpdateView.as_view(), name='vregister'), path('login', obtain_auth_token, name='login'), path('userlist', UserView.as_view(), name='userlist'), path('currentuser', CurrentUserView.as_view(), name='current user'), path('updateuser/<int:id>', VendorUpdateView.as_view(), name='update user'), path('pendinglist', PendingUserApplication.as_view(), name='pendinglist'), path('approveuser/<int:id>', ApproveUserApplicationView.as_view(), name='approve_user'), ]
from django.urls import path from rest_framework.authtoken.views import obtain_auth_token from todo_list.views import TodoListAPIView, TodoListRetrieveAPIView, TodoListItemAPIView from user.views import UserView urlpatterns = [ path('login', obtain_auth_token), path('register', UserView.as_view()), path('list', TodoListAPIView.as_view()), path('list/<int:pk>', TodoListRetrieveAPIView.as_view()), path('list/<int:list_id>/<int:pk>', TodoListItemAPIView.as_view()), ]
from django.conf.urls import url from rest_framework.authtoken import views as auth_views from user.views import UserRegistration, UserView app_name = 'user' urlpatterns = [ url(r'^$', UserView.as_view(), name='user'), url(r'^(?P<id>\d+)/$', UserView.as_view(), name='user_id'), url(r'^register/$', UserRegistration.as_view(), name='create_user'), url(r'^api-token-auth/', auth_views.obtain_auth_token, name='auth_token'), ]
from django.conf.urls import url from user.views import RegView, LoginView, UserView, UserInfoView, SendMeg urlpatterns = [ url(r'^login/$', LoginView.as_view(), name="登录"), url(r'^reg/$', RegView.as_view(), name="注册"), url(r'^member/$', UserView.as_view(), name='个人中心'), url(r'^info/$', UserInfoView.as_view(), name='个人资料'), url(r'^senMsg/$', SendMeg.as_view(), name='短信验证') ]
from django.conf.urls import url from user.views import RegisterView, ActiveView, LoginView, UserView, OrderView, AddressView, LogoutView # from django.contrib.auth.decorators import login_required urlpatterns = [ url(r'^register$', RegisterView.as_view(), name='register'), # 注册 url(r'^active/(?P<token>.*)$', ActiveView.as_view(), name='avtive'), # 激活 url(r'^login', LoginView.as_view(), name='login'), # 登录 url(r'^logout', LogoutView.as_view(), name='logout'), # 注销登录 # 由于直接使用 login_required(UserView.as_view()) 的方法使得 url 编写起来过于臃肿, # 因此单独创建一个类,继承 View 的 as_view 方法,使得 url 编写不变 # url(r'^user', login_required(UserView.as_view()), name='user'), url(r'^user', UserView.as_view(), name='user'), # 用户信息 url(r'^address', AddressView.as_view(), name='address'), # 用户地址 url(r'^order/(?P<page>\d+)$', OrderView.as_view(), name='order'), # 用户订单 ]
from django.conf.urls import url from django.contrib.auth.decorators import login_required from user.views import UserView, LoginView, UserhomeView, LogoutView app_name = 'user' urlpatterns = [ url(r'login/', LoginView.as_view(), name='login'), url(r'^home/(?P<pk>\w+)/$', login_required(UserhomeView.as_view()), name="user_home"), url(r'^logout/$', login_required(LogoutView.as_view()), name="logout"), url(r'^signup/$', UserView.as_view(), name="signup"), ]
from django.urls import path, include from user.views import SignInView, UserView urlpatterns = [ path('/signin', SignInView.as_view()), path('/signup', UserView.as_view()), ]
"""todo URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/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 from django.conf.urls import url from user.views import UserView from task.views import Task, Task_URI urlpatterns = [ path('admin/', admin.site.urls, name='admin route'), url(r'^task/(?P<id>\d+)/$', Task_URI.as_view()), # For URL Patterns "(?...)/$" path('user/', UserView.as_view()), path('task/', Task.as_view()), ]
from django.contrib import admin from django.urls import path from django.conf.urls import url from user import views from user.views import EventView, UserView, index urlpatterns = [ path('admin/', admin.site.urls), url(r'^events/', EventView.as_view()), url(r'^users/', UserView.as_view()), url(r'^registration/', views.registration, name='registration'), url(r'^login/', views.login, name='login'), url(r'^logout/', views.logout, name='logout'), path('', index), ]
from django.urls import path from user.views import UserView, UserDetailView from rest_framework_simplejwt.views import TokenObtainPairView, \ TokenRefreshView, \ TokenVerifyView app_name = 'user' urlpatterns = [ path('users/', UserView.as_view(), name='user_list'), path('detail/<int:pk>', UserDetailView.as_view(), name='user_detail'), path('token/', TokenObtainPairView.as_view(), name='token_obtain'), path('token/refresh/', TokenRefreshView.as_view(), name='token_refresh'), path('token/verify/', TokenVerifyView.as_view(), name='token_verify'), ]
from django.urls import path from rest_framework.authtoken.views import ObtainAuthToken from user.views import UserView, CreateUserView, user_logout urlpatterns = [ path('getToken/', ObtainAuthToken.as_view(), name='login'), path('register/', CreateUserView.as_view(), name='register'), path('detail/', UserView.as_view(), name='detail'), path('logout/', user_logout, name='logout'), ]
from django.urls import path from user.views import UserRegisterView, UserView, UserLogView, UserMessageView, user_ws_connect, \ csrf_token, LoginOtherView, user_ws_list, user_ws_disconnect urlpatterns = [ path('register/', UserRegisterView.as_view()), path('', UserView.as_view()), path('login/', UserLogView.as_view()), path('logout/', UserLogView.as_view()), path('loginother/', LoginOtherView.as_view()), path('message/', UserMessageView.as_view()), path('connect/', user_ws_connect), path('disconnect/', user_ws_disconnect), path('wslist/', user_ws_list), path('csrftoken/', csrf_token), ]
from django.urls import path, include from user.views import CustomObtainTokenPairView, RegisterView, UserView, \ RegisterSuperMarketView, RegisterProducerView, \ ProducerViewSet, get_producer_supermarket, \ SuperMarketViewSet, get_user_pk from rest_framework_simplejwt.views import TokenRefreshView from django.contrib.auth.views import PasswordResetView,PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView from rest_framework.routers import DefaultRouter router = DefaultRouter() router.register(r'producers', ProducerViewSet, basename='producer') router.register(r'supermarkets', SuperMarketViewSet, basename='supermarkets') urlpatterns = [ path('login/', CustomObtainTokenPairView.as_view(), name='token_obtain_pair'), path('login/refresh/', TokenRefreshView.as_view(), name='token_refresh'), path('register_market/', RegisterSuperMarketView.as_view(), name='register_market'), path('register_producer/', RegisterProducerView.as_view(), name='register_producer'), path('get_producer_supermarket/', get_producer_supermarket, name='get_producer_supermarket'), path('get_user_pk/', get_user_pk, name='get_user_pk'), path('password_recovery/', PasswordResetView.as_view(), name='password_reset'), path('password_recovery/done/', PasswordResetDoneView.as_view(), name='password_reset_done'), path('password_recovery/reset/<uidb64>/<token>/', PasswordResetConfirmView.as_view(), name='password_reset_confirm'), path('password_recovery/reset/done/', PasswordResetCompleteView.as_view(), name='password_reset_complete'), path('', UserView.as_view(), name='auth_register'), path('', include(router.urls)), ]
from django.conf.urls import url from user.views import UserView urlpatterns = [url(r'^update/(?P<pk>[0-9]+)/', UserView.as_view())]
from django.urls import path from user.views import UserView, UserDetailsView, UserRegister app_name = "user" urlpatterns = [ path("", view=UserView.as_view(), name="user-list"), path("register/", view=UserRegister.as_view(), name="user-register"), path('<str:pk>/', view=UserDetailsView.as_view(), name='user-details-update-delete') ]
"""Django_day11 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.contrib import admin from django.urls import path from user.views import UserView urlpatterns = [ path('admin/', admin.site.urls), # path('register', RegisterView.as_view() ,name='register') path('user/<int:uid>', UserView.as_view(), name='user') ]
from django.urls import path from user.views import (UserView, UserLoginView, AdminView, AdvisorsView, BookingCreateView, AdvisorsBookingView) from user.models import User from user.serializers import UserSerializer urlpatterns = [ path('user/register/', UserView.as_view()), path('user/login/', UserLoginView.as_view()), path('admin/advisor/', AdminView.as_view()), path('user/<uuid:user_id>/advisor/', AdvisorsView.as_view()), path('user/<uuid:user_id>/advisor/booking/', AdvisorsBookingView.as_view()), path('user/<uuid:user_id>/advisor/<uuid:advisor_id>/', BookingCreateView.as_view()), ]
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 rest_auth.views import LoginView from django.urls import path from rest_auth.registration.views import RegisterView from categories.views import CategoryView from tasks.views import TaskView from user.views import UserView urlpatterns = [ path('admin/', admin.site.urls), path('signin/', LoginView.as_view(), name='rest_login'), path('signup/', RegisterView.as_view(), name='rest_register'), path('user/<int:pk>', UserView.as_view({'get': 'retrieve', 'put': 'update', 'delete': 'destroy'})), path('', TaskView.as_view({'get': 'list'})), path('category/', CategoryView.as_view({'get': 'list'})), path('category/create', CategoryView.as_view({'post': 'create'})), path('category/<int:pk>', CategoryView.as_view({'get': 'retrieve', 'put': 'update', 'delete': 'destroy'})), path('task/create', TaskView.as_view({'post': 'create'})), path('task/<int:pk>', TaskView.as_view({'get': 'retrieve', 'put': 'update', 'delete': 'destroy'})), ]
from django.conf.urls import url from django.contrib import admin from user.views import UserView urlpatterns = [ url(r'^create', UserView.as_view(), name='create_user'), ]
from django.urls import path from user.views import login, UserView, token_veri app_name = "user" urlpatterns = [ path('login/', login), # 代表请求接口路径 path('all', UserView.as_view()), path('all<int:pk>', UserView.as_view()), path('token/', token_veri), # 代表请求接口路径 ]