Beispiel #1
0
from django.urls import path

from shop import views
from shop.views import ShopView, EmployeesView

urlpatterns = [
    path('shops/', ShopView.as_view(), name='shops'),
    path('employees/', EmployeesView.as_view(), name='employees'),
    path('delete/users/<int:id>/', views.delete_users, name='delete_users'),
    path('delete/employees/<int:id>/',
         views.delete_employees,
         name='delete_employees'),
    path('delete/shop/<int:id>/', views.delete_shop, name='delete_shop'),
]
Beispiel #2
0
from django.urls import path

from shop.views import (ShopView, ProductSingleView, CartView, CheckoutView,
                        PaymentView, add_to_cart, add_one_to_cart,
                        remove_one_from_cart, remove_from_cart)
app_name = 'shop'

urlpatterns = [
    path('<category>/', ShopView.as_view(), name='shop'),
    path('product-single/<slug>/',
         ProductSingleView.as_view(),
         name='product_single'),
    path('cart', CartView.as_view(), name='cart'),
    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('add-one-to-cart/<slug>/', add_one_to_cart, name='add-one-to-cart'),
    path('remove-one-from-cart/<slug>/',
         remove_one_from_cart,
         name='remove-one-from-cart'),
    path('checkout', CheckoutView.as_view(), name='checkout'),
    path('payment', PaymentView.as_view(), name='payment'),
]
Beispiel #3
0
from django.urls import path
from django.http import HttpResponse
from shop.views import HomePageView, ProductView, ShopView

urlpatterns = [
    path('', HomePageView.as_view(), name='homepage'),
    path('shop/', ShopView.as_view(), name='shop'),
    path('product/<int:pk>/', ProductView.as_view(), name='product')
]
Beispiel #4
0
from shop.views import (
    ShopView,
    ProductView,
    product_view,
    add_to_cart_view,
    cart_view,
    remove_from_cart,
    checkout_view,
    thanks_view
)

urlpatterns = [
    path("admin/", admin.site.urls),
    path("", home_screen_view, name="home"),
    path("signup/", signup_view, name="signup"),
    path("logout/", logout_view, name="logout"),
    path("signin/", signin_view, name="signin"),
    path("social-auth/", include("social_django.urls", namespace="social")),
    path("shop/", ShopView.as_view(), name="shop"),
    path("product/<slug>/", product_view, name="product"),
    path("add-to-cart/<slug>/", add_to_cart_view, name="add-to-cart"),
    path("cart/", cart_view, name="cart"),
    path("remove-from-cart/<slug>/", remove_from_cart, name="remove-from-cart"),
    path('checkout/', checkout_view, name='checkout'),
    path('thanks/', thanks_view, name='thanks'),
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Beispiel #5
0
from django.urls import path, include
from shop.views import shop_view, ShopView

urlpatterns = [
    path('', shop_view, name='shop'),
    path('api/', ShopView.as_view(), name='shop_api')
]