Esempio n. 1
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)
Esempio n. 2
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)
Esempio n. 3
0
    product_by_price_lowest,
    product_by_price_highest,
    product_by_date_oldest,
    product_by_date_newest,
)
urlpatterns = [
    url(r'^$', home_page, name='home'),
    url(r'^login/$', login_page, name='login'),
    url(r'^cart/', include(("carts.urls", 'cart'), namespace='cart')),
    url(r'^register/$', register_page, name='register'),
    url(r'logout/$', logout_page, name = 'logout'),
    url(r'^bootstrap/$', TemplateView.as_view(template_name='bootstrap/example.html')),
    url(r'^products/', include(("products.urls", 'products'), namespace='products')),
    url(r'^search/', include(("search.urls",'search'), namespace='search')),
    url(r'^admin/', admin.site.urls),
    url(r'^featured/$', ProductFeaturedListView.as_view(), name='featured'),
    url(r'^accounts/', include('allauth.urls')),
    url(r'^accounts/profile', profile_page, name='profile_page'),
    url(r'^paypal/', include('paypal.standard.ipn.urls')),
    url(r'^payment/', include(('payment.urls','payment'), namespace='payment')),
    url(r'^lowestprice/$', product_by_price_lowest, name='lowestprice'),
    url(r'^highestprice/$', product_by_price_highest, name='highestprice'),
    url(r'^oldestdate/$', product_by_date_oldest, name='oldestdate'),
    url(r'^newestdate/$', product_by_date_newest, name='newestdate'),
]


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)
Esempio n. 4
0
from django.urls import path

from .views import (home_page, about_page, contact_page, login_page,
                    register_page)

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

urlpatterns = [
    path('', home_page, name="homepage"),
    path('about/', about_page, name="about"),
    path('contact/', contact_page, name="contact"),
    path('login/', login_page, name="login"),
    path('register/', register_page, name="register"),
    path('featured/', ProductFeaturedListView.as_view(), name="featured"),
    path('featured/<int:pk>/',
         ProductFeaturedDetailView.as_view(),
         name="featured-detail"),
    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"),
    path('admin/', admin.site.urls),
]

if settings.DEBUG:
Esempio n. 5
0
    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,
        name='category-detail'),
    url(r'^category/(?P<slug>[\w-]+)/(?P<sub_slug>[\w-]+)/$',
        views.get_sub_category,
        name='subcategory-detail'),
    url(r'^category/(?P<slug>[\w-]+)/(?P<sub_slug>[\w-]+)/(?P<subsub_slug>[\w-]+)/$',
        views.get_sub_sub_category,
Esempio n. 6
0
from django.contrib import admin
from django.contrib.auth.views import LogoutView

from products.views import (ProductListView, ProductFeaturedListView,
                            ProductDetailView, ProductDetailSlugView,
                            CategoryListView, CategoryListSlugView,
                            PenListView)

from addresses.views import checkout_address_create_view
from django.views.generic import TemplateView
from accounts.views import login_page, register_page, guest_register_view
from .views import home_page, about_page, contact_page
from carts.views import cart_detail_api_view

urlpatterns = [
    url(r'^$', ProductFeaturedListView.as_view(), name='home'),
    url(r'^about/$', about_page, name='about'),
    url(r'^api/cart/$', cart_detail_api_view, name='api-cart'),
    url(r'^cart/', include("carts.urls", namespace='cart')),
    url(r'^contact/$', contact_page, name='contact'),
    url(r'^login/$', login_page, name='login'),
    url(r'^checkout/address/create/$',
        checkout_address_create_view,
        name='checkout_address_create'),
    url(r'^register/guest/$', guest_register_view, name='guest_register'),
    url(r'^logout/$', LogoutView.as_view(), name='logout'),
    url(r'^register/$', register_page, name='register'),
    url(r'^products/$', ProductListView.as_view()),
    url(r'^pen/$', PenListView.as_view(), name='pen'),

    # url(r'^search/', include("search.urls", namespace='search')),
Esempio n. 7
0
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth.views import LogoutView

from django.contrib import admin
from django.urls import path, include

from django.views.generic import TemplateView

from accounts.views import login_page, register_page, guest_register_view
from addresses.views import checkout_address_create_view, checkout_address_reuse_view
from .views import home_page, about_page, contact_page
from products.views import ProductFeaturedListView

urlpatterns = [
    path('', ProductFeaturedListView.as_view(), name='home'),
    path('about/', about_page, name='about'),
    path('contact/', contact_page, name='contact'),
    path('login/', login_page, name='login'),
    path('checkout/address/create/',
         checkout_address_create_view,
         name='checkout_address_create'),
    path('checkout/address/reuse/',
         checkout_address_reuse_view,
         name='checkout_address_reuse'),
    path('register/guest/', guest_register_view, name='guest_register'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('cart/', include("carts.urls", namespace='cart')),
    path('register/', register_page, name='register'),
    path('bootstrap/',
         TemplateView.as_view(template_name='bootstrap/example.html')),