Example #1
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time    : 2018/9/13 0013 10:16
# @Author  : Liushixin
# @Site    :
# @File    : urls.py
# @Software: PyCharm
from django.conf.urls import url

from courses.views import CoursesListView, CourseDetailView

urlpatterns = [
    url('^list/$', CoursesListView.as_view(), name='course_list'),
    url('^detail/(?P<course_id>\d+)',
        CourseDetailView.as_view(),
        name='course_detail'),
]
Example #2
0
from django.urls import path
from courses.views import CoursesCreateView, CoursesListView, CoursesUpdateView, CoursesDeleteView, \
    SearchView, course_detail

app_name = 'course'
urlpatterns = [
    path('', CoursesListView.as_view(), name="home"),
    path('courses/', CoursesListView.as_view(), name="courses"),
    path('courses/<slug:slug>/', course_detail, name="course_detail"),
    # path('courses/<slug:slug>/', CoursesDetailView.as_view(), name="course_detail"),
    path('create/', CoursesCreateView.as_view(), name="course_create"),
    path('courses/update/<slug:slug>/',
         CoursesUpdateView.as_view(),
         name="course_update"),
    path('courses/delete/<slug:slug>/',
         CoursesDeleteView.as_view(),
         name="course_delete"),
    path('search/', SearchView.as_view(), name="search"),
]
Example #3
0
File: urls.py Project: ghjan/imooc
# -*- coding: utf-8 -*-
from django.conf.urls import url
from courses.views import CoursesListView, CourseDetailView

urlpatterns = [
    url(r'^courses/list$', CoursesListView.as_view(), name="courses_list"),
    url(r'^course/detail/(?P<course_id>\d+)$',
        CourseDetailView.as_view(),
        name="course_detail"),
]
Example #4
0
from django.conf.urls import patterns, include, url
from courses.views import (CoursesListView, CoursesView,
                           CoursesCreate, CoursesUpdate,
                           CoursesDelete)


urlpatterns = patterns('',

    url(r'^$', CoursesListView.as_view(), name='Course_list'),
    url(r'^(?P<pk>\d+)/$', CoursesView.as_view(), name='Course_item'),
    url(r'^add/$', CoursesCreate.as_view(), name='course_add'),
    url(r'^edit/(?P<pk>\d+)/$', CoursesUpdate.as_view(), name='courses_edit'),
    url(r'^del/(?P<pk>\d+)/$', CoursesDelete.as_view(), name='courses_del'),
)
Example #5
0
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, include
from django.views.static import serve
from kidscreative.settings import MEDIA_ROOT

import xadmin

from blog.views import ArticlesListView, ArticleDetailView, LabelSearchView
from main.views import IndexPageView, ContactView
from courses.views import CoursesListView, CourseDetailView

urlpatterns = [
    url(r'^xadmin/', xadmin.site.urls),
    url(r'^media/(?P<path>.*)', serve, {"document_root": MEDIA_ROOT}),
    url(r'^ueditor/', include('DjangoUeditor.urls')),
    url(r'^blog/$', ArticlesListView.as_view(), name='blog'),
    url(r'^blog/article_(?P<id>\d+)/$',
        ArticleDetailView.as_view(),
        name='article_detail'),
    url(r'^blog/label_(?P<label>\w+)/$',
        LabelSearchView.as_view(),
        name='label_search'),
    url(r'^$', IndexPageView.as_view(), name='index'),
    url(r'^contact/$', ContactView.as_view(), name='contact'),
    url(r'^course/$', CoursesListView.as_view(), name='course'),
    url(r'^course/detail_(?P<id>\d+)/$',
        CourseDetailView.as_view(),
        name='course_detail'),
]
Example #6
0
from django.urls import path, re_path, include

from courses.views import CoursesListView

urlpatterns = [
    # 课程机构
    re_path(r'^list/$', CoursesListView.as_view(), name='list'),
    # re_path(r'^home/(?P<org_id>\d+)/$', OrgHomeView.as_view(), name='home'),
]