"""CVBdemo 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.contrib import admin from django.urls import path,re_path from app01.views import LoginView urlpatterns = [ path('admin/', admin.site.urls), re_path(r'^login/',LoginView.as_view()) ]
The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Add an import: from blog import urls as blog_urls 2. Import the include() function: from django.conf.urls import url, include 3. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) """ from django.conf.urls import url from django.contrib import admin from app01.views import LoginView, LogoutView, CreateUserView, CreateNamespaceView, DeleteUserView, AddExtraNamespaceView, index,details urlpatterns = [ url(r'^$', LoginView.as_view(), name='login'), url(r'^logout/', LogoutView.as_view(), name='logout'), url(r'^create_user/', CreateUserView.as_view(), name='create_user'), url(r'^create_namespace/', CreateNamespaceView.as_view(), name='create_namespace'), url(r'^extra_namespace/', AddExtraNamespaceView.as_view(), name='extra_namespace'), url(r'^index/(?P<zone>\w+)/', index, name='index'), url(r'^delete/(?P<group>\w+)/', DeleteUserView.as_view(), name='delete'), url(r'^details/(?P<zone>\w+)/(?P<selected_group>\w+)(?:/(?P<selected_namespace>.*))?', details, name='details'), ]
from django.conf.urls import url, include from app01.views import LoginView, OrderView, ParserView, \ SerializeView, test1, test2, test3, index, PageView, create, UserViewSet, UserViewSet3, OperateView,UserViewSet1 urlpatterns = [ url(r'^login/', LoginView.as_view()), # url(r'^index/', IndexView.as_view()), url(r'^order/', OrderView.as_view()), url(r'^parse/', ParserView.as_view()), url(r'^ser/', SerializeView.as_view()), # django反向生成url url(r'^test1/', test1, name='test1'), url(r'^home/', index), url(r'^test2/(\d+)/(\d+)', test2, name='test2'), url(r'^test3/(?P<k1>\d+)/(?P<k2>\d+)', test3, name='test3'), # 分页数据生成 url(r'^page_num/', PageView.as_view()), url(r'^page_limit/', UserViewSet.as_view()), url(r'^page_cursor/', UserViewSet3.as_view()), # 批量创建用户,准备数据 url(r'^create/', create), ################## 手动操作,增删改查的路由配置 # 查询所有 url(r'^operate/$', OperateView.as_view()), url(r'^operate\.(?P<format>\w+)$', OperateView.as_view()), # 按条件查询(get)\删除(put)、修改(delete) url(r'^operate/(?P<pk>\d+)/$', OperateView.as_view()),
from django.contrib import admin from django.urls import path from app01.views import RegisterView,LoginView,ShopView urlpatterns = [ path('admin/', admin.site.urls), path('register/',RegisterView.as_view(),name='register'), path('login/',LoginView.as_view(),name='login'), path('shop/',ShopView.as_view(),name='shop'), ]