"""tanzhou 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 course.views import CourseListView, CourseDetailView, LessonDetailView urlpatterns = [ # 全部课程信息 url(r'list/$', CourseListView.as_view(), name='list'), # 课程详情 url(r'details/(?P<course_id>.*)$', CourseDetailView.as_view(), name='details'), # 目录详情 url(r'lesson/(?P<course_id>.*)$', LessonDetailView.as_view(), name='lesson'), ]
from django.urls import path from rest_framework.urlpatterns import format_suffix_patterns from course.views import ( CategoryListView, CategoryDetailView, TeacherListView, TeacherDetailView, CourseListView, CourseDetailView, ProgramItemView ) app_name = 'course' urlpatterns = [ path('categories/', CategoryListView.as_view(), name='category_list'), path('categories/<int:pk>/', CategoryDetailView.as_view(), name='category_detail'), path('teachers/', TeacherListView.as_view(), name='teacher_list'), path('teachers/<int:pk>/', TeacherDetailView.as_view(), name='teacher_detail'), path('courses/', CourseListView.as_view(), name='course_list'), path('courses/<int:pk>/', CourseDetailView.as_view(), name='course_detail'), path('programs/', ProgramItemView.as_view(), name='program_list'), ] urlpatterns = format_suffix_patterns(urlpatterns)
from django.urls import path from course.views import (CourseListView, CourseDetailView, CourseCreateView, CourseUpdateView, CourseDeleteView) app_name = 'course' urlpatterns = [ path('', CourseListView.as_view(), name='list'), path('create/', CourseCreateView.as_view(), name='create'), path('<slug>/', CourseDetailView.as_view(), name='detail'), path('<slug>/update', CourseUpdateView.as_view(), name='update'), path('<slug>/delete', CourseDeleteView.as_view(), name='delete'), ]
# coding=utf-8 from django.urls import include, path from course.views import CourseDetailView from student.views import QuizListView, TakenQuizListView, take_quiz, CourseListView, course_registration, \ RegisteredCourseListView urlpatterns = [ path('student/', include(([ path('', CourseListView.as_view(), name='course_change_list'), path('viewcourse/<int:course_pk>/', CourseDetailView.as_view(), name='course_detail'), path('registered/course', RegisteredCourseListView.as_view(), name='registered_course_list'), path('register/<int:course_pk>/', course_registration, name='register_course'), path('quiz', QuizListView.as_view(), name='quiz_list'), path('taken/', TakenQuizListView.as_view(), name='taken_quiz_list'), path('quiz/<int:pk>/', take_quiz, name='take_quiz'), ], 'student'), namespace='student')), ]
CourseEvalRefCreateView, CourseEvalRefUpdateView, CourseEvalRefDeleteView, \ CourseConstraintDetailView, CourseEvalRefDetailView, \ CourseGroupConstraintCreateView, CourseGroupConstraintDetailView, \ CourseGroupConstraintUpdateView, CourseGroupConstraintDeleteView from django.conf.urls import patterns, url urlpatterns = patterns( '', url(r'^$', CourseListView.as_view(), name='course_list'), url(r'^_create/', CourseCreateView.as_view(), name='course_create'), url(r'^(?P<pkc>\d+)/$', CourseDetailView.as_view(), name='course_detail'), url(r'^(?P<pkc>\d+)/_update/$', CourseUpdateView.as_view(), name='course_update'), url(r'^(?P<pkc>\d+)/_delete/$', CourseDeleteView.as_view(), name='course_delete'), # ## Course constraints url(r'^(?P<pkc>\d+)/constraint/_create/$', CourseConstraintCreateView.as_view(), name='course_constraint_create'), url(r'(?P<pkc>\d+)/constraint/(?P<pkcc>\d+)/$', CourseConstraintDetailView.as_view(), name='course_constraint_detail'),
from django.urls import path from course.views import CourseListView, CourseDetailView urlpatterns = [ path("", CourseListView.as_view()), path("<slug:slug>/", CourseDetailView.as_view()) ]
# organization/urls.py from course.views import PostsView,CourseView,CourseDetailView,CourseInfoView,CommentsView,AddCommentsView,LessonInfoView,PostsInfoView from django.urls import path,re_path # 要写上app的名字 app_name = "course" urlpatterns = [ path('posts_list/',PostsView.as_view(),name='posts_list'), path('list/',CourseView.as_view(),name='course_list'), re_path('detail/(?P<course_id>\d+)/', CourseDetailView.as_view(), name="course_detail"), # 课程章节信息页 re_path('info/(?P<course_id>\d+)/', CourseInfoView.as_view(), name="course_info"), re_path('lesson/(?P<lesson_id>\d+)/', LessonInfoView.as_view(), name="lesson"), re_path('posts/(?P<posts_id>\d+)/', PostsInfoView.as_view(), name="posts_info"), #课程评论 re_path('comment/(?P<course_id>\d+)/', CommentsView.as_view(), name="course_comments"), #添加评论 path('add_comment/', AddCommentsView.as_view(), name="add_comment"), ]