Esempio n. 1
0
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"),
]
Esempio n. 2
0
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'),
]
Esempio n. 3
0
from django.conf.urls import url
from django.urls import path

from apps.courses.views import CourseListView, CourseDetailView, CourseLessonView, CourseCommentView, CourseVideoView

urlpatterns = [
    url(r'^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>', CourseVideoView.as_view(), name="video"),

]
Esempio n. 4
0
from django.urls import path
from apps.courses.views import CourseDetailView

urlpatterns = [
    path('<int:pk>/', CourseDetailView.as_view(), name='course_detail'),
]
Esempio n. 5
0
from apps.courses.views import CourseView, CourseDetailView, CourseLessonView, CourseCommentView, CoursePlayView
from django.conf.urls import url

urlpatterns = [
    url('^list/$', CourseView.as_view(), name='list'),
    url(r'^course(?P<course_id>\d+)/$',
        CourseDetailView.as_view(),
        name='detail'),
    url(r'^course(?P<course_id>\d+)/lesson/$',
        CourseLessonView.as_view(),
        name='lesson'),
    url(r'^course(?P<course_id>\d+)/comment/$',
        CourseCommentView.as_view(),
        name='comment'),
    url(r'^lesson(?P<lesson_id>\d+)/video(?P<video_id>\d+)/$',
        CoursePlayView.as_view(),
        name='video'),
]
Esempio n. 6
0
from django.urls import path, re_path

from apps.courses.views import CourseListView, CourseDetailView, CourseLessonView, CourseCommentView, VideoView

urlpatterns = [
    re_path("list/$", CourseListView.as_view(), name="list"),
    re_path("^(?P<course_id>\d+)/$", CourseDetailView.as_view(),
            name="detail"),
    re_path("^(?P<course_id>\d+)/lesson/$",
            CourseLessonView.as_view(),
            name="lesson"),
    re_path("^(?P<course_id>\d+)/comments/$",
            CourseCommentView.as_view(),
            name="comment"),
    re_path("^(?P<course_id>\d+)/video/(?P<video_id>\d+)$",
            VideoView.as_view(),
            name="video"),
]