# encoding: utf-8 __author__ = 'shawn' __date__ = '2017/11/7 20:30' from django.conf.urls import url from organization.views import OrgListView, OrgHomeView, OrgCourseView, OrgDescView, OrgTeacherView, UserAskView, AddFavView urlpatterns = [ # 课程机构 organization url(r'^list/$', OrgListView.as_view(), name='org_list'), url(r'^home/(?P<org_id>\d+)/$', OrgHomeView.as_view(), name='org_home'), url(r'^course/(?P<org_id>\d+)/$', OrgCourseView.as_view(), name='org_course'), url(r'^desc/(?P<org_id>\d+)/$', OrgDescView.as_view(), name='org_desc'), url(r'^teacher/(?P<org_id>\d+)/$', OrgTeacherView.as_view(), name='org_teacher'), url(r'^user_ask/$', UserAskView.as_view(), name='user_ask'), # 机构的收藏 url(r'^add_fav/$', AddFavView.as_view(), name='add_fav') ]
from django.urls import path, re_path from organization.views import OrgListView, UserAskView, OrgHomeView, OrgCoursesView, OrgDescView, OrgTeacherView, \ TeacherDetailView, TeacherListView app_name = 'organization' urlpatterns = [ path('org_list/', OrgListView.as_view(), name="org_list"), path('user_ask/', UserAskView.as_view(), name="user_ask"), # 机构首页 re_path('org_home/(?P<org_id>\d+)/', OrgHomeView.as_view(), name="org_home"), # 机构课程 re_path('org_course/(?P<org_id>\d+)/', OrgCoursesView.as_view(), name="org_course"), # 机构介绍 re_path('org_desc/(?P<org_id>\d+)/', OrgDescView.as_view(), name='org_desc'), # 机构讲师 re_path('org_teacher/(?P<org_id>\d+)/', OrgTeacherView.as_view(), name='org_teacher'), # 讲师列表 path('teacher_list/', TeacherListView.as_view(), name="teacher_list"), # 讲师介绍 re_path('teacher_detail/(?P<teacher_id>\d+)',
#coding:utf-8 __author__ = 'cccccc' __date__ = '2018/1/24 18:50' from django.conf.urls import url, include from django.contrib import admin from organization.views import OrgListView, AddAskUserView, OrgHomeView, OrgCourseView, OrgDescView, OrgTeachersView, AddFavView, TeacherListView from organization.views import TeacherDetailView urlpatterns = [ #机构页面 url(r'^list/$', OrgListView.as_view(), name="org_list"), url(r'^add_ask/$', AddAskUserView.as_view(), name="add_ask"), url(r'^home/(?P<org_id>\d+)/$', OrgHomeView.as_view(), name="org_home"), url(r'^course/(?P<org_id>\d+)/$', OrgCourseView.as_view(), name="org_course"), url(r'^de/(?P<org_id>\d+)/$', OrgDescView.as_view(), name="org_de"), url(r'^teacher/(?P<org_id>\d+)/$', OrgTeachersView.as_view(), name="org_teacher"), #用户收藏 url(r'^add_fav/$', AddFavView.as_view(), name="add_fav"), #讲师列表页 url(r'^teacher/list/$', TeacherListView.as_view(), name="teacher_list"), url(r'^teacher_detail/(?P<teacher_id>\d+)/$', TeacherDetailView.as_view(), name="teacher_detail"), ]
# _*_encoding: utf-8 _*_ __author__ = 'nzb' __date__ = '2019/2/27 10:47' from django.urls import path, include, re_path from organization.views import OrgListView, AddUserAskView, OrgHomeView, OrgCourseView, OrgDescView, OrgTeacherView, UserFavView from .views import TeacherListView, TeacherInfoView app_name = 'organization' urlpatterns = [ # 课程机构列表页 path('list/', OrgListView.as_view(), name='org_list'), path('add_ask/', AddUserAskView.as_view(), name='add_ask'), re_path('home/(?P<org_id>\d+)/', OrgHomeView.as_view(), name='org_home'), re_path('course/(?P<org_id>\d+)/', OrgCourseView.as_view(), name='org_course'), re_path('desc/(?P<org_id>\d+)/', OrgDescView.as_view(), name='org_desc'), re_path('org_teacher/(?P<org_id>\d+)/', OrgTeacherView.as_view(), name='org_teacher'), # 机构收藏 path('add_fav/', UserFavView.as_view(), name='add_fav'), # 机构讲师 path('teacher/list/', TeacherListView.as_view(), name='teacher_list'), # 讲师详情页 re_path('teacher/info/(?P<teacher_id>\d+)/',
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 organization.views import OrgListView, AddUserAskView, OrgDetailView, CourseDetailView, DescDetailView, TeachersDetailView, AddFavView urlpatterns = [ url('^list/', OrgListView.as_view(), name='org-list'), url('^add_ask/', AddUserAskView.as_view(), name='add-ask'), url('^detail-homepage/(?P<org_id>\d+)/$', OrgDetailView.as_view(), name='detail-homepage'), url('^detail-course/(?P<org_id>\d+)/$', CourseDetailView.as_view(), name='detail-course'), url('^detail-desc/(?P<org_id>\d+)/$', DescDetailView.as_view(), name='detail-desc'), url('^detail-teachers/(?P<org_id>\d+)/$', TeachersDetailView.as_view(), name='detail-teachers'), url('^add-fav/$', AddFavView.as_view(), name='add-fav'), ]