"""demo5 URL Configuration 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 from rest_framework.authtoken import views from app01.views import IndexView urlpatterns = [ path('admin/', admin.site.urls), # drf自带的token认证模式 path('api-token-auth/', views.obtain_auth_token), path('index/', IndexView.as_view(), name='index'), ]
"""demo_jwt URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/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. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin from rest_framework_jwt.views import obtain_jwt_token from app01.views import IndexView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^jwt-token-auth/', obtain_jwt_token), url(r'^index/', IndexView.as_view(), name='index'), ]
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 app01.views import index, test_index from app01.views import IndexView from stark.service.stark import site from rbac.views import login from rbac.views import logout urlpatterns = [ re_path(r'^stark/', site.urls), re_path(r'^login/$', login), re_path(r'^logout/$', logout), path('admin/', admin.site.urls), re_path(r'^$', IndexView.as_view(), name='index'), re_path(r'book/', test_index, name='index_test'), # re_path(r'^$', index, name='index') ]
"""dlogin URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/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. Import the include() function: from django.conf.urls import url, include 2. 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 AuthView,CourseView,CourseListView,IndexView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^login/',AuthView.as_view()), url(r'^index/',IndexView.as_view()), url(r'^course/',CourseView.as_view()), url(r'^course_list/',CourseListView.as_view()), # url(r'cors.html/',get_data), ]