chore: splitted views file into separated files

This commit is contained in:
2024-11-30 13:28:44 +01:00
parent e40cdee31b
commit e6680463ec
12 changed files with 99 additions and 98 deletions
+3 -5
View File
@@ -1,7 +1,8 @@
from django.urls import path
from web.views import index, product_detail, add_cart_item, delete_cart_item, login, logout, register, reset_password
from web.components.views import list_products, cart_dropdown
from web.views.components import cart_dropdown, list_products
from web.views.users import login, logout, register, reset_password
from web.views.web import add_cart_item, delete_cart_item, index, product_detail
app_name = "web"
@@ -9,17 +10,14 @@ app_name = "web"
urlpatterns = [
path("", index, name="index"),
path("products/<int:pk>/<str:slug>/", product_detail, name="product_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"),
# components
path("web/components/products/", list_products, name="list_products"),
path("web/components/cart-dropdown/", cart_dropdown, name="cart_dropdown"),
# 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"),