36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
from django.urls import path
|
|
|
|
from web.views.components import cart, cart_dropdown, list_products
|
|
from web.views.users import login, logout, my_account, register, reset_password
|
|
from web.views.web import (
|
|
add_cart_item,
|
|
cart_detail,
|
|
delete_cart_item,
|
|
index,
|
|
manifest,
|
|
product_detail,
|
|
)
|
|
|
|
app_name = "web"
|
|
|
|
urlpatterns = [
|
|
path("", index, name="index"),
|
|
path("products/<int:pk>/<str:slug>/", product_detail, name="product_detail"),
|
|
path("cart/", cart_detail, name="cart_detail"),
|
|
# users
|
|
path("login/", login, name="login"),
|
|
path("logout/", logout, name="logout"),
|
|
path("register/", register, name="register"),
|
|
path("reset-password/", reset_password, name="reset-password"),
|
|
path("my-account/", my_account, name="my_account"),
|
|
# components
|
|
path("web/components/products/", list_products, name="list_products"),
|
|
path("web/components/cart-dropdown/", cart_dropdown, name="cart_dropdown"),
|
|
path("web/components/cart/", cart, name="cart"),
|
|
# api
|
|
path("web/add-cart-item/", add_cart_item, name="add_cart_item"),
|
|
path("web/delete-cart-item/<int:pk>/", delete_cart_item, name="delete_cart_item"),
|
|
# manifest
|
|
path("manifest.json", manifest, name="manifest_json"),
|
|
]
|