from django.urls import path from products.views import ( ProductListView, ProductDetailSlugView, ) app_name = 'products' urlpatterns = [ path('', ProductListView.as_view(), name='list'), path('<slug:slug>/', ProductDetailSlugView.as_view(), name='detail'), ]
from django.conf.urls import url from products.views import ( ProductListView, ProductDetailSlugView, ProductDownloadView ) urlpatterns = [ url(r'^$', ProductListView.as_view(), name='list'), url(r'^(?P<slug>[\w-]+)/$', ProductDetailSlugView.as_view(), name='detail'), # use detail as shortcut url(r'^(?P<slug>[\w-]+)/(?P<pk>\d+)/$', ProductDownloadView.as_view(), name='download'), ]
from django.conf.urls import url from django.conf import settings from django.conf.urls.static import static from products.views import ProductListView, ProductDetailSlugView, ProductFeaturedListView urlpatterns = [ url(r'^$', ProductListView.as_view()), url(r'^(?P<slug>[\w-]+)/$', ProductDetailSlugView.as_view()), url(r'^featured/$', ProductFeaturedListView.as_view()), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.conf.urls import url from products.views import ( ProductListView, # product_list_view, # ProductDetailView, # product_detail_view, # ProductFeaturedListView, # ProductFeaturedDetailView, ProductDetailSlugView, ) urlpatterns = [ url(r'^$', ProductListView.as_view(), name="list"), # url(r'^products-fbv/$', product_list_view), # url(r'^featured/$', ProductFeaturedListView.as_view()), # url(r'^featured/(?P<pk>\d)/$', ProductFeaturedDetailView.as_view()), url(r'^(?P<slug>[\w-]+)/$', ProductDetailSlugView.as_view(), name='detail'), # url(r'^products-fbv/(?P<pk>\d)/$', product_detail_view), ]
from django.conf.urls import url from products.views import ( ProductListView, CategorytListView, ProductDetailSlugView, ) urlpatterns = [ url(r'^$', ProductListView.as_view(), name='list'), url(r'^(?P<parent_slug>[\w-]+)/(?P<slug>[\w-]+)/$', CategorytListView.as_view(), name='subcategories'), url(r'^(?P<slug>[\w-]+)/$', CategorytListView.as_view(), name='categories'), url(r'^(?P<category>[\w-]+)/(?P<subcategory>[\w-]+)/(?P<slug>[\w-]+)/$', ProductDetailSlugView.as_view(), name='detail-no-subsub'), url(r'^(?P<category>[\w-]+)/(?P<subcategory>[\w-]+)/(?P<slug>[\w-]+)/$', CategorytListView.as_view(), name='subsubcategories'), url(r'^(?P<category>[\w-]+)/(?P<subcategory>[\w-]+)/(?P<subsubcategory>[\w-]+)/(?P<slug>[\w-]+)/$', ProductDetailSlugView.as_view(), name='detail'), ]
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 from django.conf import settings from django.conf.urls.static import static from products.views import (product_list_view, ProductListView, product_detail_view, ProductFeaturedListView, ProductFeaturedDetailView, ProductDetailSlugView) from .view import home_page, login_page, register_page urlpatterns = [ path('admin/', admin.site.urls), path('', home_page, name='home_page'), path('featured/', ProductFeaturedListView.as_view()), path('featured/<int:pk>', ProductFeaturedDetailView.as_view()), path('products/', product_list_view, name='product_list_view'), path('products/<int:pk>/', product_detail_view, name='product_detail_view'), path('products/<slug:slug>/', ProductDetailSlugView.as_view()), path('login/', login_page, name='login_page'), path('register/', register_page, name='register_page'), #path('products/',ProductListView.as_view() , name='product_list_view'), ] if settings.DEBUG: urlpatterns = urlpatterns + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns = urlpatterns + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.conf.urls import url from products.views import ( ProductListView, #Product_list_view, #ProductDetailView, ProductDetailSlugView, # Product_detail_view, # ProductFeaturedListView, # ProductFeaturedDetailView, ) urlpatterns = [ # url(r'^featured/$', ProductFeaturedListView.as_view()), # url(r'^featured/(?P<pk>\d+)/$', ProductFeaturedDetailView.as_view()), url(r'^$', ProductListView.as_view(), name="list"), #url(r'^products-fbv/$', Product_list_view), #url(r'^products/(?P<pk>\d+)/$', ProductDetailView.as_view()), url(r'^(?P<slug>[\w-]+)/$', ProductDetailSlugView.as_view(),name="detail"), #url(r'^products-fbv/(?P<pk>\d+)/$', Product_detail_view), ]
product_detail, ProductFeatureListView, ProductFeatureDetailView, ProductDetailSlugView, ) from .views import * urlpatterns = [ path( '', home_page, ), path('admin/', admin.site.urls), path('contact/', contact_page), path('login/', login_page), path('register/', register_page), path('product/', ProductListView.as_view()), path('product-fbv/', product_list), #path('product/<int:pk>/', ProductDetailView.as_view()), path('product/<str:slug>/', ProductDetailSlugView.as_view()), path('product-d/', product_detail), path('feature/<int:pk>/', ProductFeatureDetailView.as_view()), path('feature/', ProductFeatureListView.as_view()), ] if settings.DEBUG: urlpatterns = urlpatterns + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns = urlpatterns + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.urls import path, include from products.views import ProductListView,ProductDetailView,create_product, edit_product, ProductDetailSlugView, ProductSaleListView,ProductSaleDetailView,make_sale_off, make_sale_on app_name = 'product' urlpatterns = [ path('', ProductListView.as_view()), path('create/', create_product, name='create'), path('sale_on/', make_sale_on, name='make-sale-on'), path('sale_off/', make_sale_off, name='make_sale_off'), path('sale/', ProductSaleListView.as_view(),name='sale'), path('sale/<int:pk>/', ProductSaleDetailView.as_view()), path('<slug>/', ProductDetailSlugView.as_view()), # path('<int:pk>/edit/', edit_product), path('<slug>/edit/', edit_product, name='edit'), ]
from django.urls import path, re_path from products.views import ( ProductListView, ProductDetailSlugView, list_of_product_by_category ) urlpatterns = [ path('', ProductListView.as_view(), name='list'), re_path(r'^(?P<slug>[\w-]+)/$', ProductDetailSlugView.as_view(), name='detail'), re_path(r'^category/(?P<category_slug>[\w-]+)/$', list_of_product_by_category, name='list_of_product_by_category'), ]
from django.urls import path from products.views import ( ProductListView, ProductDetailSlugView, ) app_name = 'products' urlpatterns = [ path('', ProductListView.as_view(), name='product_list'), path('<slug>', ProductDetailSlugView.as_view(), name='productSlugDetail'), # path('products-fbv/<productId>' , product_detail_view), # path('products-fbv' , product_list_view) , # path('featured' , ProductFeaturedListView.as_view()), # path('featured/<pk>' , ProductDetailFeaturedView.as_view()) , ]
from django.urls import path from products.views import ( # product_list_view, ProductListView, # product_detail_view, # ProductFeaturedListView, # ProductFeaturedDetailView, ProductDetailSlugView) urlpatterns = [ path('', ProductListView.as_view(), name="productList"), path('<slug>', ProductDetailSlugView.as_view(), name="productDetail"), ]
from django.urls import path,re_path from registration import views from django.conf import settings from products.views import ProductDetailSlugView,ProductListView # ,ProductFeaturedDetailView # ,ProductListView # ,product_list_view # ,product_detail_view # ,ProductDetailView) app_name="products" urlpatterns = [ path('', ProductListView.as_view(),name='list'), path('(?P<slug>[\w-]+)/',ProductDetailSlugView.as_view(),name='detail'), ]
# from chartmis.views import mis_chart_view, mis_form,get_data, ChartData # from chartmis.views import get_data, ChartData, HomeView,mis_form from chartmis.views import mis_form,mis_chart_view from catdownload.views import export_hardware_csv,export_accessory_csv,export_accessory_xlsx, export_aveng_csv,export_aveng_xlsx,export_hardware_xlsx from depreciated.views import eol_form,eol_table from duplicates.views import duplicates_form,duplicates_table from leadtime.views import lta_form,lta_table from pricevariance.views import pv_form,pv_table from price_approved.views import pa_form,pa_table from missinginfo.views import mi_form,mi_table from newproducts.views import npa_form,npa_table urlpatterns = [ url(r'^$', home_page), url(r'^products/hardware/(?P<slug>[\w-]+)/$',ProductDetailSlugView.as_view()), url(r'^products/accessory/(?P<slug>[\w-]+)/$',ProductDetailAccessorySlugView.as_view()), url(r'^products/aveng/(?P<slug>[\w-]+)/$',ProductAVEngDetailSlugView.as_view()), url(r'^products/(?P<pk>\d+)/$', product_detail_view), url(r'^admin/', admin.site.urls), url(r'^search/', include("search.urls", namespace="search")), url(r'^filters/$', filters), url(r'^people/', include('tutorial.urls')), url(r'^report_builder/', include('report_builder.urls')), url(r'^admin/dashboard/', controlcenter.urls), url(r'^hardware/', get_hardware), url(r'^accessories/', get_accessories), url(r'^aveng/', get_aveng), url(r'^monitor/', get_monitor), url(r'^desktop/', get_desktop), url(r'^laptop/', get_laptop),