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 core.views import CourseAddView, CourseList, CourseView, Index, TeacherView from report.views import ReportIndex from user.views import Login, Logout, RefreshCookies urlpatterns = [ path('admin/', admin.site.urls), path('', Index.as_view()), path('course_list/', CourseList.as_view()), path('login/', Login.as_view()), path('logout/', Logout.as_view()), path('teacher/', TeacherView.as_view()), path('course/', CourseAddView.as_view()), path('course/<int:course_id>/', CourseView.as_view()), path('report/', ReportIndex.as_view()), re_path(r'^report/*$', ReportIndex.as_view()), # 会有人访问 /// 这样的坑爹路径 path('refresh_cookies/', RefreshCookies.as_view()), ]
from django.conf.urls import url from django.contrib.auth.views import logout, login from core.views import Index, RegisterFormView, UserInfoView urlpatterns = [ url(r'^login/$', login, {'template_name': 'core/login.html'}, name='login'), url(r'^logout/$', logout, name='logout'), url(r'^$', Index.as_view(), name='index'), url(r'^register/$', RegisterFormView.as_view(), name='register'), url(r'^id(?P<pk>\d+)/$', UserInfoView.as_view(), name='userinfo'), ]
from django.conf.urls import patterns, include, url from core.views import Index urlpatterns = patterns('', url(r'^$', Index.as_view(), name='index'), )
"""django_google_calendar URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/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. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) """ from django.conf.urls import include, url from django.contrib import admin from django.contrib.auth.decorators import login_required from core.views import Index, AuthHandler urlpatterns = [ url(r'^$', login_required(Index.as_view()), name='index'), url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'core/login.html'}), url(r'^admin/', include(admin.site.urls)), url(r'^oauth2callback', login_required(AuthHandler.as_view())), ]
from django.conf.urls import url from django.contrib.auth import views as auth_views from core import views as core_views from core.views import Signup,Index,Show,Delete,Music,Dance,Birthday,SkinBurn,Ai,Index2,Formset from django.urls import path urlpatterns = [ url(r'^$', core_views.home, name='home'), url(r'^login/$', auth_views.login, {'template_name': 'login.html'}, name='login'), url(r'^logout/$', auth_views.logout, {'next_page': 'login'}, name='logout'), url(r'^Signup/$', Signup.as_view(), name='Signup'), path('emp', Index.as_view()), path('Music', Music.as_view()), path('Dance', Dance.as_view()), path('Birthday', Birthday.as_view()), path('SkinBurn', SkinBurn.as_view()), path('show', Show.as_view()), path('Ai', Ai.as_view()), path('formset', Formset.as_view()), path('reg_form', Index2.as_view()), path('delete/<int:id>/', Delete.as_view(), name='show'), ]
from django.contrib import admin from django.contrib.auth import views as auth_views from django.urls import path, re_path, include from rest_framework.routers import DefaultRouter from core.views import Index from apps.cobertura.views import CoberturaViewSet router = DefaultRouter() router.register(r'cobertura', CoberturaViewSet) urlpatterns = [ path('ingresar/', auth_views.LoginView.as_view(), name='login'), path('salir/', auth_views.LogoutView, name='logout'), path('admin/', admin.site.urls), path('api/', include(router.urls)), path('', Index.as_view(), name="index"), re_path(r'^(?:.*)/?$', Index.as_view()) ]
from django.conf.urls import url from django.contrib.auth import views as auth_views from core import views as core_views from core.views import Signup, Index, Show, Delete from django.urls import path urlpatterns = [ url(r'^$', core_views.home, name='home'), url(r'^login/$', auth_views.login, {'template_name': 'login.html'}, name='login'), url(r'^logout/$', auth_views.logout, {'next_page': 'login'}, name='logout'), url(r'^signup/$', Signup.as_view(), name='signup'), url(r'^index/$', Index.as_view()), path('show', Show.as_view()), path('delete/<int:id>/', Delete.as_view(), name='show'), ]
from django.conf.urls import url, include from django.contrib.auth import views as auth_views from django.urls import path from core import views as core_views from core.views import Signup, Index, Show urlpatterns = [ path('', core_views.home, name='home'), path('login', auth_views.login, {'template_name': 'login.html'}, name='login'), path('logout', auth_views.logout, {'next_page': 'login'}, name='logout'), path('Signup', Signup.as_view(), name='Signup'), path('index/', Index.as_view(), name='Index'), path('show/', Show.as_view(), name='show') ]
from django.urls import include from django.urls import path from rest_framework import routers from core.views import ArtistList from core.views import Index from core.views import MovieList router = routers.DefaultRouter() router.register(r'artists', ArtistList) router.register(r'movies', MovieList) urlpatterns = [ path('', include(router.urls)), path('test/', Index.as_view(), name='index') ]
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. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) """ from django.conf.urls import include, url from django.contrib import admin from core.views import Index, Finder, Auth, GetUser, ShowUsers, ShowPosts, ShowTags, ShowPostsPerTag, \ ShowConnectionsFromUser, ShowGraph, ShowNetworks, ShowPostsPerNetwork, ShowTagsPerUser, ShowPlaces, ShowTips urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^finder/', Finder.as_view()), url(r'^auth/', Auth.as_view()), url(r'^$', Index.as_view()), url(r'^users/(.+)/$', GetUser.as_view(), name='User_Detail'), url(r'^networks/$', ShowNetworks.as_view(), name='Networks'), url(r'^networks/(.+)/$', ShowPostsPerNetwork.as_view(), name='Networks_Detail'), url(r'^users/$', ShowUsers.as_view(), name="All_Users"), url(r'^posts/$', ShowPosts.as_view(), name="All_Posts"), url(r'^tags/$', ShowTags.as_view(), name="All_Tags"), url(r'^tags/from/(.+)/$', ShowTagsPerUser.as_view(), name='Tags_Per_User_Detail'), url(r'^tags/(.+)/$', ShowPostsPerTag.as_view(), name='Posts_Per_Tag_Detail'), url(r'^places/$', ShowPlaces.as_view(), name='All_Places'),
from django.urls import path, include from core.views import Index, Kitchen, AmbientViewset, MenuViewSet, TableViewSet, OrderViewSet from rest_framework import routers router = routers.SimpleRouter() router.register('ambient', AmbientViewset, basename='ambient') router.register('menu', MenuViewSet) router.register('table', TableViewSet) router.register('order', OrderViewSet) urlpatterns = [ path('api/', include(router.urls)), path('test/kitchen/', Kitchen.as_view()), path('test/<str:ambient_name>/', Index.as_view()), ]
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. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) """ from django.conf.urls import include, url from django.contrib import admin from core.views import Index, Finder, Auth, GetUser, ShowUsers, ShowPosts, ShowTags, ShowPostsPerTag, \ ShowConnectionsFromUser, ShowGraph, ShowNetworks, ShowPostsPerNetwork, ShowTagsPerUser, ShowPlaces, ShowTips urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^finder/', Finder.as_view()), url(r'^auth/', Auth.as_view()), url(r'^$', Index.as_view()), url(r'^users/(.+)/$', GetUser.as_view(), name='User_Detail'), url(r'^networks/$', ShowNetworks.as_view(), name='Networks'), url(r'^networks/(.+)/$', ShowPostsPerNetwork.as_view(), name='Networks_Detail'), url(r'^users/$', ShowUsers.as_view(), name="All_Users"), url(r'^posts/$', ShowPosts.as_view(), name="All_Posts"), url(r'^tags/$', ShowTags.as_view(), name="All_Tags"), url(r'^tags/from/(.+)/$', ShowTagsPerUser.as_view(), name='Tags_Per_User_Detail'), url(r'^tags/(.+)/$', ShowPostsPerTag.as_view(), name='Posts_Per_Tag_Detail'), url(r'^places/$', ShowPlaces.as_view(), name='All_Places'), url(r'^places/(.+)/$', ShowTips.as_view(), name='Tips_Per_Place'), url(r'^connections/from/(.+)/$', ShowConnectionsFromUser.as_view(), name='Connections_From_User'), url(r'^graph/$', ShowGraph.as_view(), name='Global_Graph'), ]
"""app 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 django.views.decorators.csrf import csrf_exempt from graphene_django.views import GraphQLView from core.views import Index urlpatterns = [ path('', Index.as_view(), name="index"), path('admin/', admin.site.urls), path("graphql/", csrf_exempt(GraphQLView.as_view(graphiql=True))), ]
from django.conf.urls import patterns, include, url from core.views import Index, TodoListAPI from rest_framework import routers router = routers.DefaultRouter() router.register(r'todo', TodoListAPI) urlpatterns = patterns('', url(r'^$', Index.as_view(), name='core.index'), url(r'^api/', include(router.urls)), )
from django.contrib import admin from django.urls import path, include from core.views import Index, Contato, RegisterView from django.contrib.auth import views as auth_views app_name = 'djangoecommerce' urlpatterns = [ path('admin/', admin.site.urls), path('', Index.as_view(), name='index'), path('catalogo/', include('catalogo.urls'), name='catalogo'), path('entrar/', auth_views.LoginView.as_view(template_name='login.html'), name='login'), path('sair/', auth_views.LogoutView.as_view(next_page='index'), name='logout'), path('conta/', include('accounts.urls'), name='accounts'), path('contato', Contato.as_view(), name='contato'), path('compras/', include('checkout.urls'), name='checkout'), path('paypal/', include('paypal.standard.ipn.urls')), ]
from django.conf.urls import url from django.contrib.auth import views as auth_views from core import views as core_views from core.views import Signup, Index, Show, Delete from django.urls import path urlpatterns = [ url(r'^$', core_views.home, name='home'), url(r'^login/$', auth_views.login, {'template_name': 'login.html'}, name='login'), url(r'^logout/$', auth_views.logout, {'next_page': 'login'}, name='logout'), url(r'^signup/$', Signup.as_view(), name='signup'), path('index', Index.as_view()), path('show', Show.as_view()), path('delete/<int:id>/', Delete.as_view(), name='show'), ]