# -*- coding: utf-8 -*- # @File : urls.py # @Author :WeiSanJin # @Time :2021/04/06 21:39 # @Site :https://github.com/WeiSanJin from django.conf.urls import url from apps.organizations.views import OrgView, AddAskView, OrgHomeView, OrgTeacherView, OrgCourseView, OrgDescView from apps.organizations.views import TeacherListView, TeacherDetailView urlpatterns = [ url(r'^list/$', OrgView.as_view(), name="list"), url(r'^add_ask/$', AddAskView.as_view(), name="add_ask"), # path('<intt:org_id>/', OrgHomeView.as_view(), name="home") url(r'^(?P<org_id>\d+)/$', OrgHomeView.as_view(), name="home"), url(r'^teacher/(?P<org_id>\d+)/$', OrgTeacherView.as_view(), name="teacher"), url(r'^course/(?P<org_id>\d+)/$', OrgCourseView.as_view(), name="course"), url(r'^desc/(?P<org_id>\d+)/$', OrgDescView.as_view(), name="desc"), # 讲师列表页 url(r'^teachers/$', TeacherListView.as_view(), name="teachers"), # 讲师详情页 url(r'^teachers/(?P<teacher_id>\d+)/$', TeacherDetailView.as_view(), name="teacher_detail"), ]
#!/usr/bin/env python # -*- coding: utf-8 -*- # 开发人员 :Davis Niu # 开发时间 :9/2/2020 8:20 AM # 文件名称 :urls.py from django.urls import re_path from apps.organizations.views import OrgView, AddAskView, OrgHomeView, OrgTeacherView urlpatterns = [ re_path(r'^list/$', OrgView.as_view(), name='list'), re_path(r'^add_ask/$', AddAskView.as_view(), name='add_ask'), re_path(r'^(?P<org_id>\d+)/$', OrgHomeView.as_view(), name='home'), re_path(r'^(?P<org_id>\d+)/teacher/$', OrgTeacherView.as_view(), name='teacher'), ]
from django.conf.urls import url from django.urls import path from apps.organizations.views import OrgView, AddConsultView, OrgHomeView, OrgTeacherView, OrgCourseView, OrgDescView, \ TeacherView, TeacherDetailView urlpatterns = [ url(r'^list/$', OrgView.as_view(), name="list"), url(r'^add_consult/', AddConsultView.as_view(), name="add_consult"), path('<int:org_id>/', OrgHomeView.as_view(), name="home"), path('<int:org_id>/teacher/', OrgTeacherView.as_view(), name="teacher"), path('<int:org_id>/course/', OrgCourseView.as_view(), name="course"), path('<int:org_id>/desc/', OrgDescView.as_view(), name="desc"), path('teachers/', TeacherView.as_view(), name="teacher-list"), path('teacher_list/<int:teacher_id>/', TeacherDetailView.as_view(), name="teacher-detail"), ]
from django.urls import path from apps.organizations.views import OrgView,AddAskView,OrgHomeView,OrgTeacherView,OrgCourseView,OrgDescView,TeacherView,TeacherDetailView urlpatterns = [ path("list/", OrgView.as_view(), name="list"), path("add_ask/", AddAskView.as_view(), name="add_ask"), path("<int:org_id>/", OrgHomeView.as_view(), name="home"), path("<int:org_id>/teacher/", OrgTeacherView.as_view(), name="teacher"), path("<int:org_id>/course/", OrgCourseView.as_view(), name="course"), path("<int:org_id>/desc/", OrgDescView.as_view(), name="desc"), path("teachers/", TeacherView.as_view(), name="teachers"), path("teachers/<int:teacher_id>/", TeacherDetailView.as_view(), name="detail"), # namespace是用于在下一个其内部的name前面添加namespace,在URL中,使用url:list进行定位 ]
from django.urls import path from apps.organizations.views import OrgView, AddAskView, OrgHomeView, OrgTeacherView, OrgCourseView, OrgDescView, TeacherListView, TeacherDetailView app_name = 'org' urlpatterns = [ #机构相关也main path('list/', OrgView.as_view(), name='list'), path('add_ask/', AddAskView.as_view(), name='add_ask'), path('<int:org_id>/', OrgHomeView.as_view(), name='home'), path('<int:org_id>/teacher/', OrgTeacherView.as_view(), name='teacher'), path('<int:org_id>/course/', OrgCourseView.as_view(), name='course'), path('<int:org_id>/desc/', OrgDescView.as_view(), name='desc'), path('teachers/', TeacherListView.as_view(), name='teachers'), path('teachers/<int:teacher_id>/', TeacherDetailView.as_view(), name='teacher_detail'), ]
# _*_ coding:utf-8 _*_ from django.conf.urls import url from apps.organizations.views import AddUserAskView, OrgHomeView, OrgCourseView, OrgDescView, OrgTeacherView, \ AddFavView, TeacherDetailView, TeacherListView, OrgListView urlpatterns = [ # 课程机构列表页 url(r'^list/$', OrgListView.as_view(), name='org_list'), url(r'^add_ask/$', AddUserAskView.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'^desc/(?P<org_id>\d+)/$', OrgDescView.as_view(), name='org_desc'), url(r'^org_teacher/(?P<org_id>\d+)/$', OrgTeacherView.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'), ]
from django.conf.urls import url from django.urls import path from apps.organizations.views import OrgView, AddAskView, OrgHomeView, OrgTeacherView, OrgCourseView, OrgDescView, TeacherListView, TeacherDetailView urlpatterns = [ url(r'^list/$', OrgView.as_view(), name="list"), url(r'^add_ask/$', AddAskView.as_view(), name="add_ask"), url(r'^(?P<org_id>\d+)/$', OrgHomeView.as_view(), name="home"), url(r'^(?P<org_id>\d+)/teacher/$', OrgTeacherView.as_view(), name="teacher"), url(r'^(?P<org_id>\d+)/course/$', OrgCourseView.as_view(), name="course"), url(r'^(?P<org_id>\d+)/desc/$', OrgDescView.as_view(), name="desc"), #讲师列表页 url(r'^teachers/$', TeacherListView.as_view(), name="teachers"), url(r'^teachers/(?P<teacher_id>\d+)/$', TeacherDetailView.as_view(), name="teacher_detail"), path('<int:org_id>/', OrgHomeView.as_view(), name="home"), ]