Exemple #1
0
 path('items/deactivate/<int:pk>/',
      login_required(ItemDeactivateView.as_view()),
      name='item-deactivate'),
 path('items/activate/<int:pk>/',
      login_required(ItemActivateView.as_view()),
      name='item-activate'),
 # PRODUCTS
 path('products/', login_required(ProductView.as_view()), name='products'),
 path('products/add/',
      login_required(ProductCreateView.as_view()),
      name='product-add'),
 path('products/edit/<int:pk>/',
      login_required(ProductEditView.as_view()),
      name='product-edit'),
 path('products/detail/<int:pk>/',
      login_required(ProductDetailView.as_view()),
      name='product-detail'),
 path('products/deactivate/<int:pk>/',
      login_required(ProductDeactivateView.as_view()),
      name='product-deactivate'),
 path('products/activate/<int:pk>/',
      login_required(ProductActivateView.as_view()),
      name='product-activate'),
 # CATEGORIES
 path('categories/',
      login_required(CategoryView.as_view()),
      name='categories'),
 path('categories/add/',
      login_required(CategoryCreateView.as_view()),
      name='category-add'),
 path('categories/edit/<int:pk>/',
Exemple #2
0
"""productsApp URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/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.contrib import admin
from django.urls import path,include
from core.views import ProductListView, ProductDetailView,ProductDetailView,ProductCreateView
urlpatterns = [
    path('admin/', admin.site.urls),
    path('', ProductListView.as_view(), name='home'),
    path('product/<int:pk>', ProductDetailView.as_view(), name='product-detail'),
    path('product', ProductCreateView.as_view(), name='create-product'),
    path('accounts/', include('django.contrib.auth.urls'))
]

from django.conf.urls import patterns, include, url
from django.contrib import admin
from core.views import (IndexView, ProductDetailView, CartIndexView, 
						CartAddorUpdateView, DeleteItemFromCart, CleanCartView)

admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$', IndexView.as_view(), name="index"),
    url(r'^product-detail/(?P<pk>\d+)/$', ProductDetailView.as_view(), name='product-detail'),
    url(r'^admin/', include(admin.site.urls)),
    url(r"", include('lot.urls')),
    url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}, name="login"),
    url(r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}, name="logout"),
    url(r'^cart/index/$', CartIndexView.as_view(), name="cart-index"),
    url(r'^cart/add/$', CartAddorUpdateView.as_view(), name="cart-add"),
    url(r'^delete-from-cart/(?P<pk>\d+)/$', DeleteItemFromCart.as_view(), name="delete-from-cart"),
    url(r'^cart/clean/$', CleanCartView.as_view(), name="clean-cart"),
)
from django.urls import path
from core.views import (HomeView, ShopView, ProductDetailView, add_to_cart,
                        remove_from_cart, remove_single_item_from_cart,
                        CartView, CheckoutView, AddCouponView, PaymentView,
                        BikashView, DbblView, contact_view, about_view,
                        blog_view)

app_name = 'core_main'

urlpatterns = [
    path('', HomeView.as_view(), name="home_view"),
    path('shop/', ShopView.as_view(), name="shop_view"),
    path('product_detail/<slug>/',
         ProductDetailView.as_view(),
         name="product_detail"),
    path('add_to_cart/<slug>/', add_to_cart, name="add_to_cart"),
    path('remove_from_cart/<slug>/', remove_from_cart,
         name="remove_from_cart"),
    path('remove_single_item_from_cart/<slug>/',
         remove_single_item_from_cart,
         name="remove_single_item_from_cart"),
    path('cart/', CartView.as_view(), name="cart"),
    path('checkout/', CheckoutView.as_view(), name="checkout"),
    path('add-coupon/', AddCouponView.as_view(), name="add-coupon"),
    path('payment_stripe/<payment_option>/',
         PaymentView.as_view(),
         name="payment"),
    path('payment_bikash/<payment_option>/',
         BikashView.as_view(),
         name="bikash"),
    path('payment_dbbl/<payment_option>/', DbblView.as_view(), name="dbbl"),
	CheckoutView,
	AddCouponView,
	PaymentView,
	BikashView,
	DbblView,
	contact_view,
	about_view,
	blog_view,
	AllProductView
)

app_name = 'core_main'

urlpatterns = [
    path('', HomeView.as_view(),name="home_view"),
    path('products/', AllProductView.as_view(),name="all_product_view"),
    path('products/categories/<slug>/', ShopView.as_view(),name="category"),
    path('product_detail/<slug>/',ProductDetailView.as_view(),name="product_detail"),
    path('add_to_cart/<slug>/',add_to_cart,name="add_to_cart"),
    path('remove_from_cart/<slug>/',remove_from_cart,name="remove_from_cart"),
    path('remove_single_item_from_cart/<slug>/',remove_single_item_from_cart,name="remove_single_item_from_cart"),
    path('cart/',CartView.as_view(),name="cart"),
    path('checkout/',CheckoutView.as_view(),name="checkout"),
    path('add-coupon/',AddCouponView.as_view(),name="add-coupon"),
    path('payment_stripe/<payment_option>/',PaymentView.as_view(),name="payment"),
    path('payment_bikash/<payment_option>/',BikashView.as_view(),name="bikash"),
    path('payment_dbbl/<payment_option>/',DbblView.as_view(),name="dbbl"),
    path('contact/', contact_view),
    path('about/', about_view),
    path('blog/', blog_view),  
]