from django.urls import path from apps.goods.views import IndexView, DetailView, ListView app_name = 'goods' urlpatterns = [ path('index', IndexView.as_view(), name='index'), path('goods/<goods_id>', DetailView.as_view(), name='detail'), # path('detail', DetailView.as_view(), name='detail'), # path('list', ListView.as_view(), name='list') path('list/<type_id>/<page>', ListView.as_view(), name='list') ]
from django.urls import re_path from apps.goods.views import IndexView, DetailView, ListView app_name = "goods" urlpatterns = [ # NOTE: # - If user visit /, return a 'static' index.html from Nginx # - If user visit /index, the index.html return from Django server re_path(r'^goods/(?P<goods_id>\d+)$', DetailView.as_view(), name='detail'), re_path(r'^list/(?P<type_id>\d+)/(?P<page>\d+)$', ListView.as_view(), name='list'), re_path(r'index', IndexView.as_view(), name='index'), ]
from django.conf.urls import url from apps.goods import views from apps.goods.views import IndexView, DetailView urlpatterns = [ url(r'^$', IndexView.as_view(), name='index'), # 首页 url(r'^index$', IndexView.as_view(), name='index'), # 首页 # url(r'^index.html$', IndexView.as_view(), name='index'), # 首页 url(r'^goods/(?P<goods_id>\d+)$', DetailView.as_view(), name='detail'), # 详情页 ]
from django.conf.urls import url from . import views from apps.goods.views import DetailView, ListView urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^detail/(?P<sku_id>\d+)$', DetailView.as_view(), name='detail'), url(r'^list/(?P<spu_id>\d+)/(?P<page_num>\d+)$', ListView.as_view(), name='list'), ]
from django.contrib import admin from django.urls import path from django.conf.urls import include from apps.goods.views import IndexView, DetailView, ListView app_name = 'daily' urlpatterns = [ path('', IndexView.as_view(), name='index'), path('detail/<id>', DetailView.as_view(), name='detail'), path('list/<int:type_id>/<int:page>', ListView.as_view(), name='list') ]
from apps.goods.views import ListView, IndexView, DetailView from django.urls import path, re_path from django.conf.urls.static import static from django.conf import settings app_name = 'apps.goods' urlpatterns = [ path('', IndexView.as_view(), name='index'), # 首页 re_path('goods/(?P<goods_id>\d+)', DetailView.as_view(), name='detail'), # 详情页 re_path('list/(?P<type_id>\d+)/(?P<page>\d+)', ListView.as_view(), name='list'), # 列表页 ]
from django.urls import path from apps.goods.views import IndexView,ListView from apps.goods.views import SKUSearchchView,DetailView,CategoryVisitCountView urlpatterns = [ path('index/',IndexView.as_view()), path('list/<category_id>/skus/',ListView.as_view()), path('search/',SKUSearchchView()), path('detail/<sku_id>/',DetailView.as_view()), path('detail/visit/<category_id>/',CategoryVisitCountView.as_view()), ]
from django.conf.urls import url from apps.goods.views import IndexView, DetailView, ListView urlpatterns = [ url("^index$", IndexView.as_view(), name='index'), url("^goods/(?P<goods_id>\d+)$", DetailView.as_view(), name='detail'), url("^list/(?P<type_id>\d+)/(?P<page>\d+)$", ListView.as_view(), name='list'), ]
from django.urls import path, re_path from apps.goods.views import IndexView, ListView, DetailView, static_index urlpatterns = [ path('', static_index, name='static_index'), # 网站首页 path('index', IndexView.as_view(), name='index'), # 登录用户访问网站首页 re_path(r'^list/(?P<type_id>\w*)/(?P<page>\d*)$', ListView.as_view(), name='list'), # 商品分类列表页 re_path(r'^detail/(?P<goods_id>\d*)$', DetailView.as_view(), name='detail'), # 商品详情页 ]
from django.conf.urls import url from apps.goods.views import IndexView, DetailView, ListView urlpatterns = [ url(r'^index$', IndexView.as_view(), name='index'), # 首页 url(r'^goods/(?P<sku_id>\d+)$', DetailView.as_view(), name='detail'), # 详情页 url(r'^list/(?P<type_id>\d+)/(?P<page>\d+)$', ListView.as_view(), name='list'), # 列表页 ]
from django.conf.urls import url from django.urls import path from apps.goods.views import IndexView, DetailView, ListView app_name = 'goods' urlpatterns = [ # url(r'^index$', IndexView.as_view(), name='index'), # 首页 path('index', IndexView.as_view(), name='index'), # 首页 # path('index', IndexView.as_view()), # 首页 # url(r'^goods/(?P<goods_id>\d+)$', DetailView.as_view(), name='detail'), # 详情页 path('goods/<int:goods>', DetailView.as_view(), name='detail'), # 详情页 url(r'^list/(?P<type_id>\d+)/(?P<page>\d+)$', ListView.as_view(), name='list'), # 列表页 ]
from django.conf.urls import url from apps.goods.views import IndexView, DetailView, ListView from django.urls import path app_name = 'goods' urlpatterns = [ path(r'', IndexView.as_view(), name='index'), # 首页 # url(r'^index$', IndexView.as_view(), name='index'), # 首页 path(r'goods/<int:sku_id>', DetailView.as_view(), name='detail'), # 详情页 path(r'list/<int:type_id>/<int:page>', ListView.as_view(), name='list'), # 列表页 ]
from django.conf.urls import url from apps.goods import views from apps.goods.views import IndexView,DetailView,ListDateView urlpatterns = [ url(r'^index$', IndexView.as_view(), name='index'), url(r'detail/(\d+)',DetailView.as_view(),name='detail'), url(r'list/(\d+)/(\d+)',ListDateView.as_view(),name='list'), ]
from django.conf.urls import url from apps.goods.views import IndexView # 登录装饰器 from django.contrib.auth.decorators import login_required from apps.goods.views import DetailView, ListView # /index urlpatterns = [ # 跳转到首页显示 url(r'^index$', IndexView.as_view(),name='index'), url(r'^goods/(?P<sku_id>\d+)$', DetailView.as_view(), name='detail'), # 详情页 url(r'^list/(?P<type_id>\d+)/(?P<page>\d+)$', ListView.as_view(), name='list'), # 列表页 ]