# _*_ coding:utf-8 _*_ __author__ = 'xuyijie' __date__ = '2018/2/24 下午2:36' from django.conf.urls import url from courses.views import CoursesListView, CourseDetailView, CourseInfoView, CourseCommentView, AddCommentView urlpatterns = [ url(r'^list/$', CoursesListView.as_view(), name='course_list'), url(r'^detail/(?P<course_id>\d+)/$', CourseDetailView.as_view(), name='course_detail'), url(r'^info/(?P<course_id>\d+)/$', CourseInfoView.as_view(), name='course_info'), url(r'^comment/(?P<course_id>\d+)/$', CourseCommentView.as_view(), name='course_comment'), url(r'^addcomment/$', AddCommentView.as_view(), name='course_addcomment'), ]
#!/usr/bin/env python # -*- coding:utf-8 -*- from django.conf.urls import url from courses.views import CourseList, CourseDetailView, CourseInfoView, CourseCommentView, AddCommentView, VideoPlayView urlpatterns = [ # 课程列表页 url(r'^list/$', CourseList.as_view(), name='course_list'), url(r'^detail/(?P<course_id>\d+)/$', CourseDetailView.as_view(), name='course_detail'), url(r'^info/(?P<course_id>\d+)/$', CourseInfoView.as_view(), name='course_info'), # 课程评论 url(r'^comment/(?P<course_id>\d+)/$', CourseCommentView.as_view(), name='course_comment'), # 添加课程评论 url(r'^add_comment/$', AddCommentView.as_view(), name='add_comment'), # 视频 url(r'^video/(?P<video_id>\d+)/$', VideoPlayView.as_view(), name='video_play'), ]
#! /usr/bin/env python # -*- coding: UTF-8 -*- # Copyright(C), 2019, Zhang Chengwei. # # Author: zhang # DATE: 2019/5/26 16:28 # IDE_NAME: PyCharm # Filename: urls.py # Version: 1.0.0 # Description: # History: from django.urls import path from courses.views import CourseView, CourseDetailView, CourseVideoView, CourseCommentView, AddCommentView urlpatterns = [ path('list/', CourseView.as_view(), name='course_list'), path('<int:course_id>/detail/', CourseDetailView.as_view(), name='course_detail'), path('<int:course_id>/video/', CourseVideoView.as_view(), name='course_video'), path('<int:course_id>/comment/', CourseCommentView.as_view(), name='course_comment'), path('add_comment/', AddCommentView.as_view(), name='add_comment'), ]
# -*- coding:utf-8 -*- __author__ = 'LXG' __date__ = '2019/12/9 9:43' from django.conf.urls import url, include from organization.views import AddUserAskView from courses.views import CourseListView, CourseDetailView, CourseInfoView, CommentView, AddCommentView, VideoPlayView urlpatterns = [ url(r'^list/$', CourseListView.as_view(), name="course_list"), url(r'^detail/(?P<course_id>\d+)/$', CourseDetailView.as_view(), name="course_detail"), url(r'^info/(?P<course_id>\d+)/$', CourseInfoView.as_view(), name="course_info"), url(r'^comment/(?P<course_id>\d+)/$', CommentView.as_view(), name="course_comment"), url(r'^add_comment/$', AddCommentView.as_view(), name="add_comment"), url(r'^video/(?P<video_id>\d+)/$', VideoPlayView.as_view(), name="video_play"), ]
The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/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 courses.views import CourseListView, CourseDetailView, CourseInfoView, CourseCommentView, AddCommentView urlpatterns = [ url('^list/', CourseListView.as_view(), name='course-list'), url('^detail/(?P<course_id>\d+)/$', CourseDetailView.as_view(), name='course-detail'), url('^info/(?P<course_id>\d+)/$', CourseInfoView.as_view(), name='course-info'), url('^comment/(?P<course_id>\d+)/$', CourseCommentView.as_view(), name='course-comment'), url('^addcomment/', AddCommentView.as_view(), name='course-addcomment'), ]
#coding=utf-8 from django.conf.urls import url from courses.views import CourseListView, CourseDetailView, CourseInfoView, CommentsView, AddCommentView urlpatterns = [ #课程列表页 url(r'^list/$', CourseListView.as_view(), name="course_list"), url(r'^detail/(?P<course_id>.*)/$', CourseDetailView.as_view(), name="course_detail"), url(r'^info/(?P<course_id>.*)/$', CourseInfoView.as_view(), name="course_info"), url(r'^comment/(?P<course_id>.*)/$', CommentsView.as_view(), name="course_comments"), url(r'^add_comment/(?P<course_id>.*)/$', AddCommentView.as_view(), name="add_comment"), ]
from django.urls import path, include, re_path from courses.views import CourseListView, CourseDetailView, CourseInfoView, CommentsView, AddCommentView, VideoPlayView app_name = "course" urlpatterns = [ # 课程列表页 path('list/', CourseListView.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('comment/(?P<course_id>\d+)/', CommentsView.as_view(), name="course_comment"), # 添加课程评论 path('add_comment/', AddCommentView.as_view(), name="add_comment"), # 视频播放 re_path('video/(?P<video_id>\d+)/', VideoPlayView.as_view(), name="video_play"), ]