from courses.views import ( CourseListView, CourseDetailView, ChapterDetailView, CourseCreateView, CoursePurchaseRedirectView, ) from django.urls import re_path app_name = 'courses' urlpatterns = [ re_path(r'^$', CourseListView.as_view(), name='list'), re_path(r'create/$', CourseCreateView.as_view(), name='create'), re_path(r'^(?P<slug>\w.+)/$', ChapterDetailView.as_view(), name='chapter_detail'), #need a lecture slug re_path(r'(?P<slug>\w.+)/purchase$', CoursePurchaseRedirectView.as_view(), name='purchase'), re_path(r'(?P<slug>\w.+)$', CourseDetailView.as_view(), name='detail'), ] #trail # re_path(r'^(?P<slug>\w.+)$', CourseDetailView.as_view(), name='detail'), # re_path(r'(?P<pk>\d+)$',ChapterDetailView.as_view(),name='chapter_detail'), # re_path(r'^(?P<course_slug>\w.+)/(?P<slug>\w.+)$', # ChapterDetailView.as_view(),name='chapter_detail'),
from django.urls import path from courses.views import CourseCreateView, CourseDestroyView, CourseListView, SubjectView urlpatterns = [ path('course/create', CourseCreateView.as_view()), path('course/view', CourseListView.as_view()), path('course/view/<int:pk>', CourseListView.as_view()), path('course/delete/<int:pk>', CourseDestroyView.as_view()), path('subject/create', SubjectView.as_view()), ]
from django.urls import path, re_path from courses.views import CourseListView, CourseDetailView, CourseInfoView, CommentsView, AddCommentsView, VideoPlayView app_name = "course" urlpatterns = [ # 课程列表url path('list/', CourseListView.as_view(), name="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('comments/(?P<course_id>\d+)/', CommentsView.as_view(), name="course_comments"), # 添加课程评论,已经把参数放到post当中了 path('add_comment/', AddCommentsView.as_view(), name="add_comment"), # 课程视频播放页 re_path('video/(?P<video_id>\d+)/', VideoPlayView.as_view(), name="video_play"), ]
from django.contrib import admin from django.urls import path, include from django.contrib.auth import views as auth_views from django.conf import settings from django.conf.urls.static import static from courses.views import CourseListView urlpatterns = [ path('accounts/login/', auth_views.LoginView.as_view(), name='login'), path('accounts/logout/', auth_views.LogoutView.as_view(), name='logout'), path('admin/', admin.site.urls), path('course/', include('courses.urls')), path('', CourseListView.as_view(), name='course_list'), path('students/', include('students.urls')) ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
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. Add an import: from blog import urls as blog_urls 2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) """ from django.conf.urls import include, url from django.contrib import admin from django.contrib.auth import views as auth from django.conf import settings from django.conf.urls.static import static from courses.views import CourseListView urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^course/', include('courses.urls')), url(r'^$', CourseListView.as_view(), name="course_list"), url(r'^students/', include('students.urls')), # использование стандартных вьюх для авторизации url(r'^accounts/login/$', auth.login, name="login"), url(r'^accounts/logout/$', auth.logout, name="logout"), ] urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# encoding: utf-8 __author__ = 'dongxiao' from django.urls import path, re_path from courses.views import CourseListView, CourseDetailView, CourseInfoView, CommentsView, AddCommentsView, VideoPlayView app_name = 'course' urlpatterns = [ # 课程列表 path('list/', CourseListView.as_view(), name='list'), # 课程详情页 re_path('course/(?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('comments/(?P<course_id>\d+)/', CommentsView.as_view(), name="course_comments"), # 添加课程评论,已经把参数放到post当中了 path('add_comment/', AddCommentsView.as_view(), name="add_comment"), # 视频播放页 re_path('video/(?P<video_id>\d+)/', VideoPlayView.as_view(), name="video_play"), ]
name='course_module_update'), path('module/<int:module_id>/content/<model_name>/create/', ContentCreateUpdateView.as_view(), name='module_content_create'), path('module/<int:module_id>/content/<model_name>/<id>/', ContentCreateUpdateView.as_view(), name='module_content_update'), path('content/<int:id>/delete/', ContentDeleteView.as_view(), name='module_content_delete'), path('module/<int:module_id>/', ModuleContentListView.as_view(), name='module_content_list'), path('module/order/', ModuleOrderView.as_view(), name='module_order'), path('content/order/', ContentOrderView.as_view(), name='content_order'), path('subject/<slug:subject>/', CourseListView.as_view(), name='course_list_subject'), path('subject/', CourseListView.as_view(), name='course_list_subject'), path('courses/', StudentCourseListView.as_view(), name='student_course_list'), path('<slug:slug>/', CourseDetailView.as_view(), name='course_detail'), path('course/<pk>/', StudentCourseDetailView.as_view(), name='student_course_detail'), path('course/<pk>/<module_id>/', StudentCourseDetailView.as_view(), name='student_course_detail_module'), ]
1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path, include from django.contrib.auth import views as auth_views from courses.views import CourseListView from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('accounts/login/', auth_views.LoginView.as_view(), name="login"), path('accounts/logout/', auth_views.LogoutView.as_view(), name="logout"), path('admin/', admin.site.urls), path('course/', include('courses.urls')), path('', CourseListView.as_view(), name="course_list"), path('students/', include('students.urls')), path('api/', include('courses.api.urls', namespace="api")), path('chat/', include('chat.urls', namespace="chat")), ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path, include from django.contrib.auth import views as auth_views from django.conf import settings from django.conf.urls.static import static from django.conf import settings from django.conf.urls.static import static from django.views.decorators.cache import cache_page from courses.views import CourseListView urlpatterns = [ path('accounts/login/', auth_views.LoginView.as_view(), name='login'), path('accounts/logout/', auth_views.LogoutView.as_view(), name='logout'), path('admin/', admin.site.urls), path('course/', include('courses.urls')), path('', cache_page(60 * 15)(CourseListView.as_view()), name='course_list'), path('students/', include('students.urls')), path('api/', include('courses.api.urls', namespace='api')), ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
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'), ]
The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/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. Add an import: from blog import urls as blog_urls 2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) """ from django.conf.urls import include, url from django.contrib import admin from django.contrib.auth import views as auth_views from courses.views import CourseListView from django.conf import settings from django.conf.urls.static import static urlpatterns = [ url(r"^accounts/login/$", auth_views.login, name="login"), url(r"^accounts/logout/$", auth_views.logout, name="logout"), url(r"^admin/", include(admin.site.urls)), url(r"^course/", include("courses.urls")), url(r"^$", CourseListView.as_view(), name="course_list"), url(r"^students/", include("students.urls")), ] urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.conf.urls import url from 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.urls import re_path, path from courses.views import CourseListView, CourseDetailView, CourseLessonView, CourseCommentsView, VideoView urlpatterns = [ re_path(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>/comments/", CourseCommentsView.as_view(), name="comments"), path("<int:course_id>/video/<int:video_id>/", VideoView.as_view(), name="video"), ]
Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path, include from django.contrib.auth import views as auth_views from courses.views import CourseListView # for media purpose from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('admin/', admin.site.urls), path('accounts/login/', auth_views.LoginView.as_view(), name='login'), # standard template registration/login.html path('accounts/logout/', auth_views.LogoutView.as_view(), name='logout'), # std. tem. registration/logged_out.html path('course/', include('courses.urls')), path('', CourseListView.as_view(), name='course_list'), # <app_name>/course/list.html path('students/', include('students.urls')), path('api/', include('courses.api.urls', namespace='api')), path('chat/', include('chat.urls', namespace='chat')), ] # for media purpose if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.urls import path from courses.views import CourseListView from . import views app_name = 'home' urlpatterns = [ path('', CourseListView.as_view(), name='home'), ]
Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path, include from django.contrib.auth import views as auth_views from courses.views import CourseListView from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('accounts/login/', auth_views.LoginView.as_view(), name='login'), path('accounts/logout/', auth_views.LogoutView.as_view(), name='logout'), path('admin/', admin.site.urls), path('course/', include('courses.urls')), path('', CourseListView.as_view(), name='course_list'), path('students/', include('students.urls')), ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url,include from django.contrib import admin from django.contrib.auth import views as auth_views from account import views as asit_view from django.conf import settings from django.conf.urls import url, static,include,handler404,handler500 from django.conf.urls.static import static from courses import views from courses.views import CourseListView urlpatterns = [ url(r'^$', views.home, name='home'), url(r'^pqskban/', admin.site.urls), url(r'^all-courses/$', CourseListView.as_view(), name='course_list'), url(r'^cart/', include('cart.urls', namespace='cart')), url(r'^course/',include('courses.urls')), url(r'^api/',include('courses.api.urls', namespace='api')), url(r'^students/', include('students.urls')), url(r'^login/$', auth_views.LoginView.as_view( template_name='accounts/login.html'), name='login'), url(r'^logout/$', auth_views.LogoutView.as_view( template_name='accounts/logged_out.html'), name='logout'), url(r'^settings/password/$',auth_views.PasswordChangeView.as_view(template_name='accounts/password_change.html'), name='password_change'), url(r'^settings/password/done/$', auth_views.PasswordChangeDoneView.as_view(template_name='accounts/password_change_done.html'), name='password_change_done'), url(r'^signup/$', asit_view.signup, name='signup'), url(r'^instructor/update/(?P<pk>\d+)/$', asit_view.ProfileUpdate.as_view(),name='profile_update'),
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, include from django.contrib import admin from django.contrib.auth import views as auth_views from courses.views import CourseListView from django.conf import settings from django.conf.urls.static import static urlpatterns = [ url(r'^accounts/login/$', auth_views.login, name='login'), url(r'^accounts/logout/$', auth_views.logout, name='logout'), url(r'^admin/', admin.site.urls), url(r'^course/', include('courses.urls')), url(r'^$', CourseListView.as_view(), name='course_list'), url(r'^students/', include('students.urls')), url(r'^api/', include('courses.api.urls', namespace='api')), ] urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# coding:utf-8 from courses.views import CourseListView, CourseDetailView, CourseVideoView, CourseCommentView, AddComment __author__ = 'nina' __date__ = '2018/1/17 14:14' from django.conf.urls import url urlpatterns = [ url(r'^list/$', CourseListView.as_view(), name='courselist'), url(r'^detail/(?P<course_id>\d+)/$', CourseDetailView.as_view(), name='coursedetail'), url(r'^video/(?P<course_id>\d+)/$', CourseVideoView.as_view(), name='video'), url(r'^comment/(?P<course_id>\d+)/$', CourseCommentView.as_view(), name='comment'), url(r'^addcomment/$', AddComment.as_view(), name='addcomment'), ]
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.conf import settings from django.urls import path, include from django.contrib.auth import views as auth_views from courses.views import CourseListView from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('', auth_views.LoginView.as_view(), name='login'), path('home/', include('home.urls'), name="homepage"), path('admin/', admin.site.urls), path('accounts/login/', auth_views.LoginView.as_view(), name='login'), path('accounts/logout/', auth_views.LogoutView.as_view(), name='logout'), path('course/', include('courses.urls')), path('subjects', CourseListView.as_view(), name='course_list'), path('students/', include('students.urls')), path('api/', include('courses.api.urls', namespace='api')), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) if settings.DEBUG: import debug_toolbar urlpatterns = [ path('__debug__/', include(debug_toolbar.urls)), ] + urlpatterns
from django.contrib import admin from django.urls import path, include, reverse_lazy from django.conf import settings from django.conf.urls.static import static from django.contrib.auth import views as auth_views from courses.views import CourseListView from account.views import index urlpatterns = [ path('admin/', admin.site.urls), path('accounts/courses/login/', auth_views.LoginView.as_view( template_name='courses/registration/login.html', success_url="/elearning/courses"), name='course_login'), path('accounts/courses/logout/', auth_views.LogoutView.as_view( template_name='courses/registration/logged_out.html'), name='course_logout'), path('account/', include("account.urls")), path('elearning/', include('courses.urls')), path('elearning/', CourseListView.as_view(), name='course_list'), path('students/', include('students.urls')), path("", index, name="index"), # path('api/', include('account.api.urls', namespace='api')), ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from courses.views import CourseListView, CourseDetailView, CourseInfoView, CommentsView, AddCommentsView, VideoPlayView from django.conf.urls import url, include app_name = "courses" urlpatterns = [ # 课程列表url 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('^comments/(?P<course_id>\d+)/$', CommentsView.as_view(), name="course_comments"), # 添加课程评论,已经把参数放到post当中了 url('^add_comment/$', AddCommentsView.as_view(), name="add_comment"), # 课程视频播放页 url('^video/(?P<video_id>\d+)/$', VideoPlayView.as_view(), name="video_play"), ]
# encoding: utf-8 __author__ = 'mtianyan' __date__ = '2018/1/13 0013 01:57' # encoding: utf-8 from courses.views import CourseListView, CourseDetailView, CourseInfoView, CommentsView, AddCommentsView, VideoPlayView from django.urls import path, re_path app_name = "courses" urlpatterns = [ # 课程列表url path('list/', CourseListView.as_view(), name="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('comments/(?P<course_id>\d+)/', CommentsView.as_view(), name="course_comments"), # 添加课程评论,已经把参数放到post当中了 path('add_comment/', AddCommentsView.as_view(), name="add_comment"), # 课程视频播放页 re_path('video/(?P<video_id>\d+)/', VideoPlayView.as_view(), name="video_play"), ]
# -*- coding: utf-8 -*- from django.conf.urls import include, url from django.contrib import admin from django.contrib.auth import views as auth_views from django.conf import settings from django.conf.urls.static import static from courses.views import CourseListView urlpatterns = [ url(r'^accounts/login/$', auth_views.login, name='login'), url(r'^accounts/logout/$', auth_views.logout, name='logout'), url(r'^admin/', include(admin.site.urls)), url(r'^course/', include('courses.urls')), url(r'^students/', include('students.urls')), url(r'^$', CourseListView.as_view(), name='course_list'), url(r'^api/', include('courses.api.urls', namespace='api')), ] #可以直接访问静态文件 urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
""" educa URL Configuration """ from django.contrib import admin from django.urls import path, include from django.conf import settings from django.conf.urls.static import static from django.contrib.auth import views as auth_views from courses.views import CourseListView urlpatterns = [ path('admin/', admin.site.urls), path('accounts/login/', auth_views.LoginView.as_view(), name='login'), path('accounts/logout/', auth_views.LogoutView.as_view(), name='logout'), path('course/', include('courses.urls')), path('', CourseListView.as_view(), name='course_list'), path('students/', include('students.urls')), ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# _*_ encoding:utf-8 _*_ from django.conf.urls import url from courses.views import CourseProgessView, SearchView, FightDetailView, CourseListView, CourseDetailView, AddFavoriteView, VideoPlayView, CommentsView, AddCommentsView __author__ = 'YZF' __date__ = '2018/3/26,9:09' urlpatterns = [ url(r'^list', CourseListView.as_view(), name="courser_list"), url(r'^detail/(?P<course_id>\d+)/', CourseDetailView.as_view(), name='course_detail'), url(r'^fightdetail/(?P<course_id>\d+)/', FightDetailView.as_view(), name='fight_detail'), url(r'^addfav/', AddFavoriteView.as_view(), name="addfav_course"), url(r'^video/(?P<video_id>\d+)/', VideoPlayView.as_view(), name="video"), url(r'^progess/', CourseProgessView.as_view(), name="progess"), url(r'^comments/(?P<course_id>\d+)/', CommentsView.as_view(), name="comments"), url(r'^addcomments/', AddCommentsView.as_view(), name="addcomments"), url(r'^search/', SearchView.as_view(), name="search"), ]
# -*- coding: utf-8 -*- """ @Datetime: 2019/2/27 @Author: Zhang Yafei """ from django.urls import re_path, path from courses.views import VideoPlayView, CourseListView, CourseDetailView, CourseInfoView, CommentsView, AddComentsView app_name = 'course' urlpatterns = [ # 课程列表页 re_path(r'^list/$', CourseListView.as_view(), name="course_list"), # 课程详情页 re_path(r'^detail/(?P<course_id>\d+)/$', CourseDetailView.as_view(), name="course_detail"), # 课程章节信息 re_path(r'^info/(?P<course_id>\d+)/$', CourseInfoView.as_view(), name="course_info"), # 课程评论 re_path(r'^comment/(?P<course_id>\d+)/$', CommentsView.as_view(), name="course_comments"), # 添加课程评论 re_path(r'^add_comment/$', AddComentsView.as_view(), name="add_comment"), # 播放视频 path('video/<int:video_id>', VideoPlayView.as_view(), name="video_play"), ]