# -*- coding: utf-8 -*- # @Time : 2020/3/1 20:40 # @Author : Skylor Tang # @Email : # @File : urls.py.py # @Software: PyCharm from django.conf.urls import url from apps.courses.views import CourseListView, CourseDetailView, CourseLessonView, CourseCommentsView, VideoView urlpatterns = [ # 课程列表 url(r'^list/$', CourseListView.as_view(), name='list'), # 因为使用了命名空间,所以之前的命令和此处冲突没有问题 # 课程详情 url(r'^(?P<course_id>\d+)/$', CourseDetailView.as_view(), name="detail"), # 课程详情 url(r'^(?P<course_id>\d+)/lesson/$', CourseLessonView.as_view(), name="lesson"), # 课程评论 url(r'^(?P<course_id>\d+)/comments/$', CourseCommentsView.as_view(), name="comments"), # 视频播放 url(r'^(?P<course_id>\d+)/video/(?P<video_id>\d+)$', VideoView.as_view(),
from django.conf.urls import url from django.urls import path from apps.courses.views import CourseListView, CourseDetailView, CourseLessonView, CourseCommentsView, VideoView urlpatterns = [ url(r'^list/$', CourseListView.as_view(), name='list'), url(r'^(?P<course_id>\d+)/$', CourseDetailView.as_view(), name="detail"), url(r'^(?P<course_id>\d+)/lesson/$', CourseLessonView.as_view(), name="lesson"), url(r'^(?P<course_id>\d+)/comments/$', CourseCommentsView.as_view(), name="comments"), url(r'^(?P<course_id>\d+)/video/(?P<video_id>\d+)$', VideoView.as_view(), name="video"), ]
from django.conf.urls import url from django.urls import path from apps.courses.views import CourseListView, CourseDetailView, CourseLessonView, CourseCommentsView, VideoView, HomeworkView urlpatterns = [ url(r'^list/$', CourseListView.as_view(), name="list"), url(r'^(?P<course_id>\d+)/$', CourseDetailView.as_view(), name="detail"), url(r'^(?P<course_id>\d+)/lesson/$', CourseLessonView.as_view(), name="lesson"), url(r'^(?P<course_id>\d+)/comments/$', CourseCommentsView.as_view(), name="comments"), url(r'^(?P<course_id>\d+)/video/(?P<video_id>\d+)$', VideoView.as_view(), name="video"), url(r'^(?P<course_id>\d+)/homework/(?P<homework_id>\d+)$', HomeworkView.as_view(), name="homework"), ]
from django.urls import path, include, re_path from apps.courses.views import CourseListView urlpatterns = [ path('course-list/', CourseListView.as_view(), name="course-list"), re_path(r'org-home(?P<org_id>.*)/$', CourseListView.as_view(), name="org-home"), ]
from django.urls import path from apps.courses.views import CourseListView, CourseDetailView, CourseLessonView, CourseCommentView, VideoView urlpatterns = [ path("list/", CourseListView.as_view(), name="list"), path("<int:course_id>/", CourseDetailView.as_view(), name="detail"), path("<int:course_id>/lesson", CourseLessonView.as_view(), name="lesson"), path("<int:course_id>/comment", CourseCommentView.as_view(), name="comment"), path("<int:course_id>/video/<int:video_id>/", VideoView.as_view(), name="video"), ]
from django.urls import path from apps.courses.views import CourseListView, CourseDetailView, CourseLessonView, CourseCommentView, VieoView app_name = 'course' urlpatterns = [ path('list/', CourseListView.as_view(), name='list'), path('<int:course_id>/', CourseDetailView.as_view(), name='detail'), path('<int:course_id>/lesson/', CourseLessonView.as_view(), name='lesson'), path('<int:course_id>/comment/', CourseCommentView.as_view(), name='comment'), path('<int:course_id>/video/<int:video_id>', VieoView.as_view(), name='video'), ]
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.urls import path from apps.courses.views import (CourseListView, CourseDetailView, ExerciseDetailView, UserExpectedAnswerView) app_name = 'apps.courses' urlpatterns = [ path('', CourseListView.as_view(), name='course_list'), path('courses/exercise/answer/', UserExpectedAnswerView.as_view(), name='exercise_send_answer'), path('courses/<slug:slug>/', CourseDetailView.as_view(), name='course_detail'), path('courses/<slug:slug>/exercise/<int:id>/console/', ExerciseDetailView.as_view(), name='exercise_detail'), ]