Example #1
0
from django.urls import path

from products.views import (
    ProductListView,
    ProductDetailSlugView,
)
app_name = 'products'

urlpatterns = [
    path('', ProductListView.as_view(), name='list'),
    path('<slug:slug>/', ProductDetailSlugView.as_view(), name='detail'),
]
Example #2
0
"""
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)
Example #3
0
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()),
]
Example #4
0
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'),
]
Example #5
0
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.contrib import admin
from django.urls import path, include
from ecommerce_site.views import home_page, about_page, contact_page, login_page, register_page
from products.views import ProductListView, product_list_view
urlpatterns = [
    path('admin/', admin.site.urls),
    path('', home_page),
    path('about/', about_page),
    path('contact/', contact_page),
    path('login/', login_page),
    path('register/', register_page),

    # products
    path('product/', ProductListView.as_view()),
    path('product-fbv/', product_list_view)
]
Example #6
0
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')
]
Example #7
0
"""shop URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.1/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
from products.views import ShopTemplateView, ProductListView, ProductDetailView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', ShopTemplateView.as_view(), name='main-page'),
    path('products/', ProductListView.as_view(), name='products-list'),
    path('products/<int:pk>/',
         ProductDetailView.as_view(),
         name='product-detail'),
]
Example #8
0
from django.urls import path
from django.conf.urls.static import static
from django.conf import settings

from products.views import ProductDetailView, ProductListView

urlpatterns = [
    path('', ProductListView.as_view(), name="product-list"),
    path('products/<int:pk>/',
         ProductDetailView.as_view(),
         name="product-detail")
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Example #9
0
from django.conf.urls import url

from products.views import (
    ProductListView,
    #product_list_view,
    #product_detail_view,
    #ProductDetailView,
    ProductDetailSlugView,
    #ProductFeaturedListView,
    #ProductFeaturedDetailView
)

urlpatterns = [
    url('(?P<slug>[\w-]+)/$', ProductDetailSlugView.as_view()),
    url('$', ProductListView.as_view()),

    #url('products/(?P<pk>\d+)/$', ProductDetailView.as_view()),
]
Example #10
0
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, include
from django.conf import settings
from django.contrib import admin
from django.conf.urls.static import static
from products.views import ProductListView, ProductsSearchView
from .views import home

urlpatterns = [
    # url(r'/$', home, name="home"),
    url(r'^$', ProductListView.as_view(), name='home'),
    url(r'^cart/', include("cart.urls")),
    url(r'^admin/', admin.site.urls),
    url(r'^products/', include("products.urls")),
    url(r'^search$', ProductsSearchView.as_view(), name="search"),
    url(r'^accounts/', include("accounts.urls")),
    url('^', include('django.contrib.auth.urls'))
]

urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
#     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.urls import path
from products import views
from products.views import (ProductListView, ProductDetailsView,
                            CreateProductView, UpdateProductView,
                            DeleteProductView)

app_name = 'products'

urlpatterns = [
    # path('products/',views.home, name='home')
    path('products/', ProductListView.as_view(), name='allproduct'),
    path('details/<int:pk>',
         ProductDetailsView.as_view(),
         name='productdetails'),
    path('create/', CreateProductView.as_view(), name='Create_product'),
    path('update/<int:pk>', UpdateProductView.as_view(),
         name='update_product'),
    path('delete/<int:pk>', DeleteProductView.as_view(),
         name='delete_product'),
    path('fav/<int:id>/', views.favourite_add, name='favourite_add'),
    path('profile/favourites/', views.favourite_list, name='favourite_list'),
]
Example #12
0
from products import views
from products.views import (
    ProductListView,
    # ProductDetailView,
    ProductFeaturedListView,
    ProductFeaturedDetailView,
    ProductDetailSlugView,
    # ProductCategoryListView,
    # ProductCategoryDetailView,
)

app_name = 'product'

urlpatterns = [
    url(r'^$', ProductListView.as_view(), name='product-view'),
    #      url(r'^/(?P<pk>\d+)/$',ProductDetailView.as_view(),name='product-details'),
    url(r'^(?P<slug>[\w-]+)/$',
        ProductDetailSlugView.as_view(),
        name='product-details'),
    url(r'^featured/$',
        ProductFeaturedListView.as_view(),
        name='product-featured-view'),
    url(r'^featured/details/(?P<pk>\d+)/$',
        ProductFeaturedDetailView.as_view(),
        name='product-featured-details'),

    #      url(r'^category/$', ProductCategoryListView.as_view(), name='category-list'),
    #      url(r'^category/(?P<slug>[\w-]+)/$', ProductCategoryDetailView.as_view(), name='category-detail'),
    url(r'^category/(?P<slug>[\w-]+)/$',
        views.get_category,
Example #13
0
"""products URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.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 import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include

from products.views import ProductListView

urlpatterns = [
    path('', ProductListView.as_view(), name="home"),
    path('api/', include("products.api.urls")),
    path('admin/', admin.site.urls),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Example #14
0
"""onlinestore URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.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.contrib import admin
from django.urls import include, path
from products.api.views import ProductDetailAPIView, ProductListCreateAPIView
from products.views import (ProductDetaiView, ProductListView,
                            ManufacturerListView)

urlpatterns = [
    path("products/", ProductListView.as_view(), name="product-list"),
    path("products/<int:pk>",
         ProductDetaiView.as_view(),
         name="product-detail"),
    path("manufacturer/",
         ManufacturerListView.as_view(),
         name="manufacturer-list"),
]
Example #15
0
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'),
]
Example #16
0
from django.conf.urls import url, include
from django.conf.urls import url
from django.contrib import admin
from user_auth.views import UserCreateView, CartDetailView, CartUpdateView, ProfileDetailView, \
                            IndexView, ProfileUpdateView
from products.views import ProductListView, ProductDetailView, AddToCartView, RemoveFromCartView, \
                           ReviewCreateView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^', include("django.contrib.auth.urls")),
    url(r'^$', IndexView.as_view(), name='index_view'),
    url(r'^create/user$', UserCreateView.as_view(), name="user_create_view"),
    url(r'^products/$', ProductListView.as_view(), name="product_list_view"),
    url(r'^product/(?P<pk>\d+)/$',
        ProductDetailView.as_view(),
        name='product_detail_view'),
    url(r'^product/(?P<pk>\d+)/add-to-cart/$',
        AddToCartView.as_view(),
        name='add_to_cart_view'),
    url(r'^product/(?P<pk>\d+)/remove-from-cart/$',
        RemoveFromCartView.as_view(),
        name='remove_from_cart_view'),
    url(r'^cart/(?P<pk>\d+)/$',
        CartDetailView.as_view(),
        name='cart_detail_view'),
    url(r'^cart/(?P<pk>\d+)/checkout$',
        CartUpdateView.as_view(),
        name='cart_update_view'),
    url(r'^profile/(?P<pk>\d+)/$',
        ProfileDetailView.as_view(),
Example #17
0
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'),
]
Example #18
0
"""
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'),    



]
Example #19
0
from django.conf.urls import url


from products.views import (
    ProductListView,
    # product_list_view,
    # ProductDetailView,
    # product_detail_view,
    # ProductFeaturedListView,
    # ProductFeaturedDetailView,
    ProductDetailSlugView,
)


urlpatterns = [
    url(r'^$', ProductListView.as_view(), name="list"),
    # url(r'^products-fbv/$', product_list_view),
    # url(r'^featured/$', ProductFeaturedListView.as_view()),
    # url(r'^featured/(?P<pk>\d)/$', ProductFeaturedDetailView.as_view()),
    url(r'^(?P<slug>[\w-]+)/$',
        ProductDetailSlugView.as_view(), name='detail'),
    # url(r'^products-fbv/(?P<pk>\d)/$', product_detail_view),
]
Example #20
0
from django.urls import path, re_path, include
from products.views import (ProductListView, ProductDetailView,
                            ProductFeaturedListView, ProductFeaturedDetailView)

app_name = 'products'

urlpatterns = [
    re_path(r'^$', ProductListView.as_view(), name='productlist'),
    re_path(r'^(?P<slug>[\w-]+)/$',
            ProductDetailView.as_view(),
            name='productdetail')
    # path('featured/', ProductFeaturedListView.as_view() , name='featuredproductlist'),
    # path('featured/detail-<slug:slug>/', ProductFeaturedDetailView.as_view() , name='featuredproductdetail')
]
Example #21
0
from django.conf.urls import url
from django.conf import settings
from django.conf.urls.static import static
from products.views import ProductListView, ProductDetailSlugView, ProductFeaturedListView

urlpatterns = [
    url(r'^$', ProductListView.as_view()),
    url(r'^(?P<slug>[\w-]+)/$', ProductDetailSlugView.as_view()),
    url(r'^featured/$', ProductFeaturedListView.as_view()),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Example #22
0
from django.conf.urls import url
from products.views import ProductListView, ProductDetail, SearchView

urlpatterns = [
    url(
        r'^search/$',
        SearchView.as_view(),
        name='search',
    ),
    url(r'^$', ProductListView.as_view(), name='product_all'),
    url(r'^(?P<slug>[-\w]+)/$', ProductListView.as_view(),
        name='product_list'),
    url(r'^(?P<slug>[-\w]+)/(?P<product_slug>[-\w]+)/$',
        ProductDetail.as_view(),
        name='product_detail'),
]
Example #23
0
from . import views

from django.contrib import admin
from django.urls import path
from products.views import ProductListView
from django.urls import include
from django.conf.urls.static import static
from django.conf import settings

urlpatterns = [
    # path ('', views.index, name="index"),
    path('', ProductListView.as_view(), name="index"),
    path('users/login', views.login_view, name="login"),
    path('users/logout', views.logout_view, name="logout"),
    path('users/registro', views.registro, name="registro"),
    path('admin/', admin.site.urls),
    path('productos/', include('products.urls')),
    path('carrito/', include('carts.urls')),
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Example #24
0
"""
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from Xandar import settings
from django.contrib.auth import views as auth_views
from accounts import views
from products.views import ProductListView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('account/', include('accounts.urls')),
    path('', include('core.urls')),
    path('product/', include('products.urls')),
    path('operations/', include('operations.urls')),
    path('product_list/', ProductListView.as_view(), name="product_list"),
    path('orders/', include('orders.urls')),
    path('forgot_password/', views.check_email, name="check_email"),
    path('password-reset',
         auth_views.PasswordResetView.as_view(
             template_name='accounts/password_reset.html',
             html_email_template_name="accounts/email_reset_template.html",
             email_template_name='accounts/password_reset_email.html',
             subject_template_name="accounts/password_reset_subject.txt",
         ),
         name="password_reset"),
    path('password-reset/done',
         auth_views.PasswordResetDoneView.as_view(
             template_name='accounts/password_reset_done.html'),
         name="password_reset_done"),
    path('password-reset-complete/',
Example #25
0
from products.views import ProductListView
from django.contrib import admin
from django.urls import path
from . import views
from django.urls import include
from django.conf.urls.static import static
from django.conf import settings


urlpatterns = [
    path('admin/', admin.site.urls),
    path('', ProductListView.as_view(), name='index'),
    path('usuarios/login', views.login_view, name='login'),
    path('usuarios/logout', views.logout_view, name='logout'),
    path('usuarios/registro', views.register, name='register'),
    path('productos/', include('products.urls')),
    path('carrito/', include('carts.urls'))
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Example #26
0
from django.urls import path
from products.views import ProductListView, ProductDetailView

app_name = "products"
urlpatterns = [
    path('', ProductListView.as_view(), name='home'),
    path('detail/<slug:slug>/', ProductDetailView.as_view(), name='detail'),
]
Example #27
0
    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')
]
Example #28
0
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')
]
Example #29
0
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'),
]
Example #30
0
    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, re_path
from django.conf.urls import include
from registration import views
from django.conf import settings
from django.conf.urls.static import static

from products.views import (ProductDetailSlugView, ProductFeaturedDetailView,
                            ProductFeaturedListView, ProductListView,
                            product_list_view, product_detail_view,
                            ProductDetailView)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('about/', views.about, name='about'),
    path('', ProductListView.as_view(), name='eshop'),
    path('registration/', include('registration.urls')),
    path('logout/', views.user_logout, name='logout'),
    path('special/', views.special, name='special '),
    path('feature/', ProductFeaturedListView.as_view()),
    re_path('featured/(?P<pk>\d+)/', ProductFeaturedDetailView.as_view()),
    path('product/', include("products.urls", namespace="products")),
    #path('cart/',include('cart.urls',namespace='cart')),
    path('paypal/', include('paypal.standard.ipn.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Example #31
0
from django.conf.urls import url
from products.views import (
    ProductListView,
    ProductDetail,
    SearchView,
)

urlpatterns = [
    url(r'^category/(?P<slug>[-\w]+)/$',
        ProductListView.as_view(),
        name='product_list'),
    url(r'^category/(?P<slug>[-\w]+)/product/(?P<pk>\d+)/$',
        ProductDetail.as_view(),
        name='product_detail'),
    url(
        r'^search/$',
        SearchView.as_view(),
        name='search',
    ),
]
Example #32
0
from django.conf.urls.static import static

from django.contrib import admin
from django.views.generic import TemplateView

from products.views import ProductListView, ProductDetailView, ProductCreateView, ProductUpdateView, ProductDeleteView
from carts.views import CartView, CheckoutView, CheckoutFinalView
from orders.views import AddressSelectFormView, UserAddressCreateView, OrderList, OrderDetail

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"),