PostListView, PostDetailView, PostCreateView, PostUpdateView, PostDeleteView ) from products.views import products_view, ProductDetailView from register.views import register_view, profile, preference from homepage.views import filter_block_one_books, search_function urlpatterns = [ path('admin/', admin.site.urls), path('', home_view, name='home'), path('products/', products_view, name='products'), path('products/<int:pk>/', ProductDetailView.as_view(), name='product-detail'), path('products/<filter>/', filter_block_one_books, name='filter'), path('search/', search_function, name='search_function'), # Cart / Order / Buy now path('cart/', cart_view, name='cart'), path('orders/', all_orders, name='orders'), path('order_event/', order_success, name='order_event'), path('cart/<int:item_id>/', add_to_cart, name='add_to_cart'), path('cart/remove/<int:id>/', remove_from_cart, name='remove_from_cart'), path('products/buy/<int:id>/', buy_now, name='buy_now'), # Accounts Related path('register/', register_view, name='register'), path('login/', auth_views.LoginView.as_view(template_name='login.html'), name='login'), path('logout/', auth_views.LogoutView.as_view(template_name='logout.html'), name='logout'),
from django.conf.urls import url from products.views import ProductDetailView, ProductListView, VariationListView urlpatterns = [ url(r'^$', ProductListView.as_view(), name='list'), url(r'^(?P<pk>\d+)/$', ProductDetailView.as_view(), name='detail'), url(r'^(?P<pk>\d+)/inventory/$', VariationListView.as_view(), name='inventory'), ]
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.urls import path from products.views import ProductListView, product_list_view, ProductDetailView, product_detail_view from .views import home_page, about_page, contact_page, login_page, register_page urlpatterns = [ path('', home_page), path('about/', about_page), path('contact/', contact_page), path('login/', login_page), path('register/', register_page), path('admin/', admin.site.urls), path('products/', ProductListView.as_view()), path('products-fbv/', product_list_view), path('products/<pk>/', ProductDetailView.as_view()), path('products-fbv/<pk>/', product_detail_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)
1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.urls import path, re_path from products.views import ProductListView, product_list_view, ProductDetailView, product_detail_view from .views import home_page, about_page, contact_page, login_page, register_page urlpatterns = [ path('', home_page), path('about/', about_page), path('contact/', contact_page), path('login/', login_page), path('register/', register_page), path('products/', ProductListView.as_view()), path('products-fbv/', product_list_view), re_path(r'products/(?P<pk>\d+)/', ProductDetailView.as_view()), re_path(r'products-fbv/(?P<pk>\d+)/', product_detail_view), path('admin/', admin.site.urls), ] 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 from products.views import ProductDetailView, ProductListView, ProductCreateView, ProductUpdateView, ProductDeleteView, \ ProductDownloadView app_name = "products" urlpatterns = [ path('', ProductListView.as_view(), name="index"), path('<int:pk>', ProductDetailView.as_view(), name="detail"), path('<slug:slug>', ProductDetailView.as_view(), name="detail_slug"), path('<int:id>/download', ProductDownloadView.as_view(), name="download"), path('<slug:slug>/download', ProductDownloadView.as_view(), name="download_slug"), path('create/', ProductCreateView.as_view(), name="create"), path('<int:pk>/edit', ProductUpdateView.as_view(), name="update"), path('<slug:slug>/edit', ProductUpdateView.as_view(), name="update_slug"), path('<int:pk>/delete', ProductDeleteView.as_view(), name="delete"), path('<slug:slug>/delete', ProductDeleteView.as_view(), name="delete_slug"), ]
from django.urls import path from products.views import ProductDetailView, ProductSearchListView app_name = 'products' urlpatterns = [ path('search', ProductSearchListView.as_view(), name='search'), path('<slug:slug>', ProductDetailView.as_view(), name='product'), ]
from django.conf.urls import url from products.views import ProductListView, ProductDetailView, VariationListView urlpatterns = [ url(r'^detail/(?P<pk>[\d]+)$', ProductDetailView.as_view(), name='detail'), url(r'^detail/(?P<pk>[\d]+)/inventory$', VariationListView.as_view(), name='variation_list'), # url(r'^create$', 'products.views.create_view', name='create'), # url(r'^$', 'products.views.product_list', name='list'), url(r'^$', ProductListView.as_view(), name='list') ]
from django.urls import path from . import views from django.contrib.auth import views as auth_views from products.views import ProductDetailView urlpatterns = [ path('', views.home_view, name='product_home'), path('login/', auth_views.LoginView.as_view(template_name='products/login.html'), name='login'), path('logout/', auth_views.LogoutView.as_view(template_name='products/logout.html'), name='logout'), path('register/', views.register_page, name='register'), path('card_view/', views.card_view, name='card_view'), path('about/', views.about_view, name='product_about'), path('contact/', views.contact_view, name='product_contact'), path('product/<int:pk>/', ProductDetailView.as_view(template_name='products/product_detail.html'), name='product_detail'), path('create_product/', views.create_product, name='product_create'), path('edit_product/<int:pk>/', views.edit_product, name='product_edit'), path('delete_product/<int:pk>/', views.delete_product, name='product_delete'), path('categories/', views.categories_view, name='categories_home'), path('create_category', views.create_category, name='category_create'), path('categories/edit_category/<int:pk>/', views.edit_category, name='category_edit'), path('categories/delete_category/<int:pk>/', views.delete_category, name='category_delete'), ]
from django.conf.urls import include, url from django.contrib import admin from products.views import ( ProductCreateView, ProductDetailView, ProductListView, ProductUpdateView, ) urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^create/$', 'products.views.create_view', name="create_view"), url(r'^detail/(?P<object_id>\d+)/edit/$', 'products.views.update_view', name='detail_view'), url(r'^detail/(?P<object_id>\d+)/$', 'products.views.detail_view', name='detail_view'), url(r'^detail/(?P<slug>[\w-]+)/$', 'products.views.detail_slug_view', name='detail_slug'), url(r'^list/$', 'products.views.list_view', name="list_view"), url(r'^products/$', ProductListView.as_view(), name="product_list_view"), url(r'^products/add/$', ProductCreateView.as_view(), name="product_create_view"), url(r'^products/(?P<pk>\d+)/$', ProductDetailView.as_view(), name='product_detail_view'), url(r'^products/(?P<slug>[\w-]+)/$', ProductDetailView.as_view(), name='product_detail_view'), url(r'^products/(?P<pk>\d+)/edit/$', ProductUpdateView.as_view(), name='product_update_view'), url(r'^products/(?P<slug>[\w-]+)/edit/$', ProductUpdateView.as_view(), name='product_update_view'), ]
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.urls import path from products.views import ( products, product_view, product_create_view, product_update_view, product_delete_view, ProductListView, ProductDetailView, ProductCreateView, ProductUpdateView, ProductDeleteView ) app_name = 'products' urlpatterns = [ path('', ProductListView.as_view(), name='products'), path('create/', ProductCreateView.as_view(), name='create'), path('<str:slug>/', ProductDetailView.as_view(), name='view'), path('<str:slug>/update/', ProductUpdateView.as_view(), name='update'), path('<str:slug>/delete/', ProductDeleteView.as_view(), name='delete'), ]
from django.urls import path, re_path from products.views import (ProductListView, ProductDetailView, ) app_name="products" urlpatterns = [ path('', ProductListView.as_view(), name="list"), re_path(r'^(?P<slug>[\w-]+)/$', ProductDetailView.as_view(), name='detail'), ]
from django.conf.urls import url from django.contrib import admin import products.views from products.views import ( ProductCreateView, ProductDetailView, ProductDownloadView, ProductListView, ProductUpdateView, ) urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$',ProductListView.as_view(),name='list'), url(r'^add/$',ProductCreateView.as_view(),name='create'), url(r'^(?P<pk>\d+)$',ProductDetailView.as_view(),name='detail'), url(r'^(?P<pk>\d+)/download/$',ProductDownloadView.as_view(),name='download'), url(r'^(?P<pk>\d+)/edit/$',ProductUpdateView.as_view(),name='update'), url(r'^(?P<slug>[\w.@+-]+)/$',ProductDetailView.as_view(),name='detail_slug'), url(r'^(?P<slug>[\w.@+-]+)/download/$',ProductDownloadView.as_view(),name='download_slug'), url(r'^(?P<slug>[\w.@+-]+)/edit/$',ProductUpdateView.as_view(),name='update_slug'), ]
urlpatterns = [ url(r"^$", TemplateView.as_view(template_name = "index.html"), name="index"), url(r'^admin/', admin.site.urls), url(r'^accounts/', include('allauth.urls')), url(r'^products/$', ProductListView.as_view(), name = "products_list_view"), url(r'^create/product$', ProductCreateView.as_view(), name = "products_create_view"), url(r'^update/product/(?P<pk>\d+)$', ProductUpdateView.as_view(), name = "products_update_view"), url(r'^delete/product/(?P<pk>\d+)$', ProductDeleteView.as_view(), name = "products_delete_view"), url(r'^products/(?P<pk>\d+)$', ProductDetailView.as_view(), name = "products_detail_view"), url(r'^products/(?P<slug>[\w-]+)$', ProductDetailView.as_view(), name = "products_slug_view"), url(r'^cart/$', CartView.as_view(), name = "cart"), url(r'^orders/$', OrderList.as_view(), name = "orders"), url(r'^orders/(?P<pk>\d+)$', OrderDetail.as_view(), name = "order_detail"), url(r'^checkout/$', CheckoutView.as_view(), name = "checkout"), url(r'^checkout/address/$', AddressSelectFormView.as_view(), name = "address_form"), url(r'^checkout/address/add$', UserAddressCreateView.as_view(), name = "user_address_create"), url(r'^checkout/final/$', CheckoutFinalView.as_view(), name = "checkout_final"),
from django.urls import path from products.views import ( ProductListView, ProductDetailView, ) urlpatterns = [ path('', ProductListView.as_view(), name='list'), path('<str:slug>', ProductDetailView.as_view(), name='detail'), ]
from django.urls import path from products.views import ProductListView, ProductReviewView, ProductDetailView urlpatterns = [ path('', ProductListView.as_view()), path('/boomdoggy', ProductReviewView.as_view()), path('/detail/<int:product_id>', ProductDetailView.as_view()), ]
from django.urls import path from products.views import CategoryView, SubCategoryView, ProductsListView, ProductDetailView, ProductSearchView urlpatterns = [ path('/category', CategoryView.as_view()), path('/category/<int:id>', SubCategoryView.as_view()), path('/', ProductsListView.as_view()), path('/<int:id>', ProductDetailView.as_view()), path('/search', ProductSearchView.as_view()), ]
from django.contrib import admin from django.urls import path, include from products.views import ProductListView, ProductSlugDetailView, ProductDetailView app_name = 'products' urlpatterns = [ path('', ProductListView.as_view(), name='list'), path('<int:pk>/', ProductDetailView.as_view()), path('<slug:slug>/', ProductSlugDetailView.as_view(), name='detail') ]
from django.conf.urls import url from products.views import ProductListView, ProductDetailView, VariationListView urlpatterns = [ url(r'^$', ProductListView.as_view(), name="product_list"), url(r'^(?P<pk>\d+)$', ProductDetailView.as_view(), name="product_detail"), url(r'^(?P<pk>\d+)/inventory$', VariationListView.as_view(), name="product_inventory"), ]
from django.conf.urls import include, url from products.views import ProductListView, ProductDetailView urlpatterns = [ url(r'^product/new/$', 'products.views.product_create', name='product_create'), url(r'^product/(?P<slug>[\w-]+)/$', ProductDetailView.as_view(), name='product_detail'), url(r'^product/(?P<slug>[\w-]+)/edit/$', 'products.views.product_edit', name='product_edit'), url(r'^products/$', ProductListView.as_view(), name='product_list'), ]
from django.urls import path from products.views import (ProductListView, view_product_list, ProductDetailView, view_product_detail, ProductFeaturedListView, ProductFeaturedDetailView, ProductDetailSlugView) urlpatterns = [ path('products/', ProductListView.as_view()), path('fn-product-list', view_product_list, name='product-list'), path('cb-product-detail/<int:pk>', ProductDetailView.as_view()), path('products/<str:slug>/', ProductDetailSlugView.as_view()), path('fn-product-detail/<int:pk>', view_product_detail, name='product-detail'), path('featured/', ProductFeaturedListView.as_view()), path('fn-product-detail/<int:pk>', view_product_detail, name='product-detail'), ]
"""eatseminole URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/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 django.contrib import admin from products.views import ProductDetailView, ProductListView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', ProductListView.as_view()), url(r'^products/(?P<slug>[\w-]+)/$', ProductDetailView.as_view()), ]
from django.urls import path from products.views import ProductDetailView, All_Products app_name = 'products' urlpatterns = [ path('', All_Products.as_view(), name='products'), path('<pk>/', ProductDetailView.as_view(), name='product_detail'), ]
from django.conf.urls import url from products.views import ( ProductListView, product_list_view, ProductDetailView, ProductDetailSlugView, product_detail_view, ProductFeaturedDetailView, ProductFeaturedListView ) urlpatterns = [ #url('^featured/$',ProductFeaturedListView.as_view()), #url('^featured/(?P<pk>\d+)/$',ProductFeaturedDetailView.as_view()), url('^$',ProductListView.as_view()), #url('^products-fbv/$',product_list_view), url('^(?P<pk>\d+)/$',ProductDetailView.as_view()), url('^(?P<slug>[\w-]+)/$',ProductDetailSlugView.as_view()), #url('^products-fbv/(?P<pk>\d+)/$',product_detail_view), #url('^contact/$',contactpage), ]
from django.conf.urls import url from products.views import ProductDetailView, ProductListView, VariationListView urlpatterns = [ url(r'^$', ProductListView.as_view(), name='product_list'), url(r'^(?P<pk>\d+)/$', ProductDetailView.as_view(), name='product_detail'), url(r'^(?P<pk>\d+)/inventory/$', VariationListView.as_view(), name='product_inventory'), ]
The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: 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.conf.urls.static import static from django.contrib import admin from django.urls import path from ecommerce import settings from .views import index, contact, thanks, login_auth, register from products.views import ProductListView, ProductDetailView urlpatterns = [ path('admin/', admin.site.urls), path('', index), path('contact/', contact), path('thanks/', thanks), path('login/', login_auth), path('products/', ProductListView.as_view()), path('products/<int:pk>', ProductDetailView.as_view()), path('register/', register), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.conf.urls import patterns, include, url from products.views import ProductDetailView, ProductListView from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: url(r'^$', 'products.views.home', name='home'), # url(r'^blog/', include('blog.urls')), # url(r'^blog/', include('blog.urls')), #url(r'^$', 'ProductList', name='product_list'), url(r'^products/(?P<slug>[\w\-\W]+)', ProductDetailView.as_view()), url(r'^products/$', ProductListView.as_view(), name='product'), url(r'^add/$', 'products.views.add', name='add'), url(r'^contacto/$', 'products.views.contacto', name='contacto'), url(r'^gracias/$', 'products.views.gracias', name='gracias'), url(r'^contactomail/$', 'products.views.contactomail', name='contactomail'), url(r'^admin/', include(admin.site.urls)), )
from django.urls import path from products.views import ( HomeView, ProductDetailView, ProductBuyView, search_result, CategoryView, ) urlpatterns = [ path("", HomeView.as_view(), name="home"), path('products/search/', search_result, name="searchresult"), path("products/<slug:slug>/", ProductDetailView.as_view(), name="detail"), path("products/<slug:slug>/buy/", ProductBuyView.as_view(), name="buy"), path('categories/<category>/', CategoryView.as_view(), name="categories"), ]
""" from django.conf.urls import include, url from django.contrib import admin from products.views import ( ProductCreateView, ProductDetailView, ProductListView, ProductUpdateView, ) urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^create/$', 'products.views.create_view', name='create_view'), url(r'^detail/(?P<object_id>\d+)/edit/$', 'products.views.update_view', name='update_view'), url(r'^detail/(?P<object_id>\d+)/$', 'products.views.detail_view', name='detail_view'), url(r'^detail/(?P<slug>[/w-]+)/$', 'products.views.detail_slug_view', name='detail_slug_view'), url(r'^list/$', 'products.views.list_view', name='list_view'), url(r'^products/$', ProductListView.as_view(), name='product_list_view'), url(r'^products/add/$', ProductCreateView.as_view(), name='product_create_view'), url(r'^products/(?P<slug>[\w-]+)/$', ProductDetailView.as_view(), name='product_detail_slug_view'), url(r'^products/(?P<pk>\d+)/$', ProductDetailView.as_view(), name='product_detail_view'), url(r'^products/(?P<pk>\d+)/edit/$', ProductUpdateView.as_view(), name='product_update_view'), url(r'^products/(?P<slug>[\w-]+)/edit/$', ProductUpdateView.as_view(), name='product_update_view'), ]
""" from django.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.urls import path from main_app.views import home_page, about_page, register_page, contact_page, login_page from products.views import product_list_view, ProductListView, product_detail_view, ProductDetailView urlpatterns = [ path('admin/', admin.site.urls), path('', home_page, name="home"), path('about/', about_page, name="about"), path('login/', login_page, name="login"), path('register/', register_page, name="register"), path('contact/', contact_page, name="contact"), path('products/', ProductListView.as_view(), name="products"), path('products-fbv/', product_list_view, name="products-fbv"), path('products/<int:pk>/', ProductDetailView.as_view(), name="products-detail"), path('products-fbv/<int:pk>/', product_detail_view, name="products-detail-fbv"), ] 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 HomeView, ProductDetailView, ProductBuyView urlpatterns = [ path('', HomeView.as_view(), name='home'), path('products/<slug:slug>/', ProductDetailView.as_view(), name='detail'), path('products/<slug:slug>/buy/', ProductBuyView.as_view(), name='buy'), ]
1. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import include, url from django.conf import settings from django.contrib import admin from django.shortcuts import render_to_response #from django.conf.urls.defaults import * from django.conf.urls.static import static from ecom import settings from products.views import ProductListView, product_list_view, ProductDetailView, product_detail_view from .views import home_page, about_page, contact_page, login_page, register_page urlpatterns = [ url(r'^$', 'ecom.views.home'), url(r'^$',home_page), url(r'^about/$',about_page), url(r'^contact/$',contact_page), url(r'^login/$',login_page), url(r'^register/$',register_page), url(r'^products/$',ProductListView.as_view()), url(r'^products-fbv/$',product_list_view), url(r'^products/(?P<pk>\d+)/$',ProductDetailView.as_view()), url(r'^products-fbv/(?P<pk>\d+)/$',product_detail_view), url(r'^static/(?P<path>.*)$', 'django.views.static.serve'), url(r'^admin/', include(admin.site.urls)), url(r'^path/to/blog/', include('wordpress.urls')), url(r'^catalog/$', 'ecom.views.home'), url(r'^myapp/', include('myapp.urls')), url(r'^hello/', 'myapp.views.hello', name = 'hello'), #url(r'^$', 'products', { 'template_name':'products/index.html'}, 'products_home') ]
from django.urls import path from products.views import (ProductListView, ProductDetailView) app_name = "products" urlpatterns = [ path("", ProductListView.as_view(), name="list"), path("<slug:slug>", ProductDetailView.as_view(), name='detail') ]
from django.urls import path # Импортируем свою функцию from products.views import (ProductCreateView, ProductUpdateView, ProductDeleteView, ProductListView, ProductDetailView, product_list, product_detail, product_create, product_update, product_delete) app_name = 'products' urlpatterns = [ path('<int:pk>/delete/', ProductDeleteView.as_view(), name='delete'), path('<int:pk>/update/', ProductUpdateView.as_view(), name='update'), # path('create/', product_create, name='create'), path('create/', ProductCreateView.as_view(), name='create'), path('<int:pk>/', ProductDetailView.as_view(), name='detail'), path('', ProductListView.as_view(), name='catalog'), ]
def test_product_detail_resolve_productdetailview(self): view = resolve(self.product.get_absolute_url()) self.assertEqual(view.func.__name__, ProductDetailView.as_view().__name__)