from django.conf.urls import patterns, url from django.views.generic import TemplateView from product.views import ProductCategoryView, ProductListView, ProductInfoView urlpatterns = patterns("", url(r"^(?P<category>\d+)$", ProductCategoryView.as_view(), name="product_category"), url(r"^(?P<category>\d+)/(?P<type>\d+)$", ProductListView.as_view(), name="product_list"), url(r'^info/(?P<pk>\d+)$', ProductInfoView.as_view(), name="product_detail"), )
The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ 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 from django.contrib import admin from django.views.generic import TemplateView from product.views import ProductListView, ProductDetailView, ProductCreateView from cart.views import CartListView, CartClass urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', ProductListView.as_view()), url(r'^contact/', TemplateView.as_view(template_name="contact.html")), url(r'^about/', TemplateView.as_view(template_name="about.html")), url(r'^create/$', ProductCreateView.as_view(), name='create'), url(r'^cart/$', CartListView.as_view(), name='cartlist'), url(r'^buyitem/$', CartClass.as_view(), name='BuyItem'), url(r'^(?P<slug>[\w-]+)/$', ProductDetailView.as_view()), ]
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.contrib import admin from django.views.generic import TemplateView from order.views import OrderViewSet, OrderView from product.views import ProductListView from rest_framework.routers import DefaultRouter from django.conf import settings from django.views.static import serve router = DefaultRouter() router.register(r'orders', OrderViewSet) urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^api/', include(router.urls)), url(r'^$', ProductListView.as_view(), name='home'), url(r'^order-list/$', TemplateView.as_view(template_name="order-list.html")), url(r'^order/(?P<id>\d+)/$', OrderView.as_view(), name='order'), url(r'^media/(?P<path>.*)$', serve, { 'document_root': settings.MEDIA_ROOT, }), ]
from django.urls import path from product.views import CategoryListView, CategoryView, ProductListView, ProductView, ProductsView # prefix category/ urlpatterns = [ path('', CategoryListView.as_view()), path('<int:pk>/', CategoryView.as_view()), path('<int:pk>/product/', ProductListView.as_view()), path('<int:pk2>/product/<int:pk>/', ProductView.as_view()), path('all/', ProductsView.as_view()), ]
"""myfirstprojec URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/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 product.views import ProductDetailView, ProductListView urlpatterns = [ path('', ProductListView.as_view(), name='product-list'), path('<int:pk>/', ProductDetailView.as_view(), name='product-detail'), path('admin/', admin.site.urls) ]
from django.conf.urls import patterns, url from django.contrib.auth.decorators import login_required from product.views import (ProductListView, ProductDetailView, CreateCommentView, ProductLikeView) urlpatterns = patterns('', url(r'^comment/', CreateCommentView.as_view(), name='comment'), url(r'^(?P<slug>[a-zA-Z0-9_\-]*)/$', ProductDetailView.as_view(), name='product-detail'), url(r'^(?P<slug>[a-zA-Z0-9_\-]*)/like/$', login_required(ProductLikeView.as_view()), name='like-product'), url(r'^$', ProductListView.as_view(), name='product-list'), )
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 django.conf import settings from django.conf.urls.static import static from product.views import ProductListView from django.urls import include from django.contrib.auth import views as auth_views urlpatterns = [ path('admin/', admin.site.urls), path('accounts/login/', auth_views.login, name='login'), path('logout/', auth_views.logout, {'next_page': 'root'}, name='logout'), path('gallery/', ProductListView.as_view(), name="gallery"), path('', ProductListView.as_view(), name="root"), path('', include('gallery_backend.urls')), ] urlpatterns = urlpatterns + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns = urlpatterns + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
from django.conf.urls import url from product.single_product import SingleProductListView, SingleProductCreateView from product.views import ProductListView, ProductListAPIView, IncomeListView, ProductImportView, ProductUpdateView, \ ProductDetailView, ProductImageImportView, ProductUpdateIcecatView, ProductCreateView, ProductDeleteView, \ ProductSingleUpdateView, OnlineSkuDeleteView, CreatePackingUnitProduct urlpatterns = [ url(r'^$', ProductListView.as_view(), name="list"), url(r'^single/$', SingleProductListView.as_view(), name="single_list"), url(r'^api/$', ProductListAPIView.as_view(), name="apilist"), url(r'^api/income/$', IncomeListView.as_view(), name="income"), url(r'^import/$', ProductImportView.as_view(), name="import"), url(r'^import_images/$', ProductImageImportView.as_view(), name="import_images"), url(r'^create/$', ProductCreateView.as_view(), name="create"), url(r'^create/single/$', SingleProductCreateView.as_view(), name="create_single"), url(r'^(?P<pk>\d+)/edit/$', ProductUpdateView.as_view(), name="edit"), url(r'^(?P<pk>\d+)/single/edit/$', ProductSingleUpdateView.as_view(), name="edit_single"), url(r'^(?P<pk>\d+)/edit/icecat/$', ProductUpdateIcecatView.as_view(), name="edit_icecat"), url(r'^(?P<pk>\d+)/$', ProductDetailView.as_view(), name="detail"), url(r'^delete/$', ProductDeleteView.as_view(), name="delete"), url(r'^sku/delete/(?P<pk>\d+)/$', OnlineSkuDeleteView.as_view(), name="sku_delete"), url(r'^create/packing_unit/product/(?P<pk>\d+)/$', CreatePackingUnitProduct.as_view(), name="create_packing_unit"), ]
from purchase.views import CheckoutView from shopping_cart.views import add_product, list_cart_itens, calculate_delivery, remove_item_cart, update_cart from wishlist.views import WishListListView, WishListDeleteView, WishListItemDeleteView, add_item_wishlist urlpatterns = [ url(r'^grappelli/', include('grappelli.urls')), # grappelli URLS url(r'^admin/', include(admin.site.urls)), url(r'^$', HomePageView.as_view(), name='home_page'), url(r'login/$', login, name='login'), url(r'logout/$', logout, name='logout'), # Products url(r'products/$', ProductListView.as_view(), name='products-list'), url(r'products/add/$', ProductCreateView.as_view(), name='products-add'), url(r'products/(?P<slug>[-_\w]+)/$', ProductDetailView.as_view(), name='products-detail'), url(r'products/json/(?P<slug>[-_\w]+)/$', product_detail_json, name='products-detail-json'), # Category url(r'category/(?P<name>[-\w]+)/$', ProductCategoryListView.as_view(), name='category-list'), # Cart url(r'cart/add/(?P<slug>[-_\w]+)/$', add_product, name='cart-add'), url(r'cart/list/$', list_cart_itens, name='cart-list'), url(r'cart/calculateDelivery/(?P<zip_code>[-\d]+)/$', calculate_delivery, name='cart-calculate-delivery'), url(r'cart/remove/(?P<pk>\d+)/', remove_item_cart, name='cartitem-delete'), url(r'cart/update/', update_cart, name='update-cart'), # Purchase
from django.contrib import admin from django.urls import path from customer.views import index, JoinView, LoginView, logout, CustomerListApiView, CustomerApiView from order.views import OrderAddView, OrderListView, OrderListApiView, OrderApiView from product.views import ProductListView, ProductAddView, ProductView, ProductListApiView, ProductApiView urlpatterns = [ path("s/a/console/", admin.site.urls), path('', index), path("join/", JoinView.as_view()), path("login/", LoginView.as_view()), path("logout/", logout), path("product/", ProductListView.as_view()), path("product/add", ProductAddView.as_view()), path("product/<int:pk>", ProductView.as_view()), path("order/", OrderListView.as_view()), path("order/add", OrderAddView.as_view()), path("api/product", ProductListApiView.as_view()), path("api/product/<int:pk>", ProductApiView.as_view()), path("api/customer", CustomerListApiView.as_view()), path("api/customer/<int:pk>", CustomerApiView.as_view()), path("api/order", OrderListApiView.as_view()), path("api/order/<int:pk>", OrderApiView.as_view()), ]
from django.urls import path from product.views import ProductCreateView, ProductListView, ProductUpdateView app_name = 'product' urlpatterns = [ path('p/create', ProductCreateView.as_view(), name='test'), path('p/list', ProductListView.as_view(), name='list'), path('p/update/<int:pk>', ProductUpdateView.as_view(), name='list'), ]
from django.conf.urls.defaults import url, patterns from django.contrib.auth.decorators import login_required from product.views import ProductListView, ProductAddView, ProductDetailView, CommentAddView,\ CommentDeleteView, ProductFileAddView, get_file, ProductFileDeleteView urlpatterns = patterns('product.views', url(r'^$', login_required(ProductListView.as_view()), name='product-list'), url(r'^zgloszenia$', login_required(ProductListView.as_view()), name='product-list'), url(r'^zgloszenia/(?P<status>\w+)$', login_required(ProductListView.as_view()), name='product-list-by-status'), url(r'^zgloszenie/(?P<pk>\d+)$', login_required(ProductDetailView.as_view()), name='product-details'), url(r'^klient/(?P<pk>\d+)/nowe_zgloszenie$', login_required(ProductAddView.as_view()), name='product-add'), url(r'^zgloszenie/(?P<product_id>\d+)/nowy_komentarz$', login_required(CommentAddView.as_view()), name='comment-add'), url(r'^komenatrz/usun/(?P<pk>\d+)$', login_required(CommentDeleteView.as_view()), name='comment-del'), url(r'^zgloszenie/(?P<pk>\d+)/pliki/dodaj/$', login_required(ProductFileAddView.as_view()), name='product-file-add'), url(r'^zgloszenie/(?P<product_id>\d+)/plik/pobierz/(?P<pk>\d+)/$', login_required(get_file), name='product-get-file'), url(r'^zgloszenie/(?P<product_id>\d+)/plik/usun/(?P<pk>\d+)/$', login_required(ProductFileDeleteView.as_view()), name='product-delete-file') )
from order.views import OrderCreate from product.views import ProductListView, ProductRegister, ProductDetailView from django.urls import path from . import views from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('', ProductListView.as_view(), name='ProductListView'), path('register/', ProductRegister.as_view(), name='ProductRegister'), path('<int:pk>/', ProductDetailView.as_view(), name='product_detail'), #path('order/create/', OrderCreate.as_view(), name='ordercreate'), ] urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.conf.urls import url, patterns from django.contrib.auth.decorators import login_required from product.views import ProductListView, ProductAddView, ProductDetailView, CommentAddView, \ CommentDeleteView, ProductFileAddView, get_file, ProductFileDeleteView urlpatterns = patterns( 'product.views', url(r'^$', login_required(ProductListView.as_view()), name='product-list'), url(r'^zgloszenia$', login_required(ProductListView.as_view()), name='product-list'), url(r'^zgloszenia/(?P<status>\w+)$', login_required(ProductListView.as_view()), name='product-list-by-status'), url(r'^zgloszenie/(?P<pk>\d+)$', login_required(ProductDetailView.as_view()), name='product-details'), url(r'^klient/(?P<pk>\d+)/nowe_zgloszenie$', login_required(ProductAddView.as_view()), name='product-add'), url(r'^zgloszenie/(?P<product_id>\d+)/nowy_komentarz$', login_required(CommentAddView.as_view()), name='comment-add'), url(r'^komenatrz/usun/(?P<pk>\d+)$', login_required(CommentDeleteView.as_view()), name='comment-del'), url(r'^zgloszenie/(?P<pk>\d+)/pliki/dodaj/$', login_required(ProductFileAddView.as_view()), name='product-file-add'), url(r'^zgloszenie/(?P<product_id>\d+)/plik/pobierz/(?P<pk>\d+)/$',
from django.conf.urls import url from product.views import ProductListView, ProductDetailView app_name = 'product' urlpatterns = [ url(r'^$', ProductListView.as_view(), name='list'), url(r'^(?P<pk>\d+)/$', ProductDetailView.as_view(), name='detail'), ]
from product.views import (ProductCreateView, ProductDetailView, ProductListView, ProductCategoryListView, product_detail_json) from purchase.views import CheckoutView from shopping_cart.views import add_product, list_cart_itens, calculate_delivery, remove_item_cart, update_cart from wishlist.views import WishListListView, WishListDeleteView, WishListItemDeleteView, add_item_wishlist urlpatterns = [ url(r'^grappelli/', include('grappelli.urls')), # grappelli URLS url(r'^admin/', include(admin.site.urls)), url(r'^$', HomePageView.as_view(), name='home_page'), url(r'login/$', login, name='login'), url(r'logout/$', logout, name='logout'), # Products url(r'products/$', ProductListView.as_view(), name='products-list'), url(r'products/add/$', ProductCreateView.as_view(), name='products-add'), url(r'products/(?P<slug>[-_\w]+)/$', ProductDetailView.as_view(), name='products-detail'), url(r'products/json/(?P<slug>[-_\w]+)/$', product_detail_json, name='products-detail-json'), # Category url(r'category/(?P<name>[-\w]+)/$', ProductCategoryListView.as_view(), name='category-list'), # Cart url(r'cart/add/(?P<slug>[-_\w]+)/$', add_product, name='cart-add'),
from django.conf.urls import url from product.views import ProductListView, ProductFullListView, ProductDetailView urlpatterns = [ url(r'^detail/(?P<slug>[^/]+)/$', ProductDetailView.as_view(), name='product-details'), url(r'^full/$', ProductFullListView.as_view(), name='product-full-list'), url(r'^$', ProductListView.as_view(), name='product-list'), ]
from django.conf import settings from django.conf.urls.static import static from django.conf.urls import url from django.urls import path, re_path from product.views import ProductListView from .views import SubcategoryListView urlpatterns = [ url(r'^(?P<slug>[\w-]+)/$', SubcategoryListView.as_view()), re_path(r'^([-a-zA-Z0-9_]+)/(?P<slug>[\w-]+)/$', ProductListView.as_view()), #url(r'^kids/(?P<slug>[\w.-]+)/$', ProductListView.as_view()), #url(r'^(?P<id>\d+)/(?P<slug>[-\w]+)/$', views.product_detail, name='product_detail'), #url(r'^(?P<slug>[\w-]+)/$', ProdDetailListView.as_view()), #path('prodlistdetail/', views.ProdDetailListView.as_view(), name='product_list_detail'), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
"""newproject URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.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.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.urls import include, path from django.views.generic import TemplateView from product.views import ProductListView urlpatterns = [ path('', ProductListView.as_view(), name='index'), path('urun/', include('product.urls')), path('admin/', admin.site.urls), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.urls import path from product.views import AddView, ProductListView, EditProductView app_name = "product" urlpatterns = [ path("new", AddView.as_view(), name="new"), path("list", ProductListView.as_view(), name="list"), # pk - primary key, czyli identyfikator produktu path("edit/<pk>", EditProductView.as_view(), name="edit"), ]
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 cart.views import CartList, OrderList, OrderDetail, make_order from product.views import ProductListView, ProductDetailView, add_to_cart, remove_from_cart urlpatterns = [ path('', ProductListView.as_view(), name="home"), path('cart/', CartList.as_view(), name="cart-list"), path('orders/', OrderList.as_view(), name="order-list"), path('orders/make/<int:pk>', make_order, name="make-order"), path('orders/<int:pk>', OrderDetail.as_view(), name="order-detail"), path('add_to_cart/', add_to_cart, name='add_to_cart'), path('remove_from_cart/', remove_from_cart, name='remove_from_cart'), path('account/', include('registration.backends.default.urls')), path('admin/', admin.site.urls), path('<slug:slug>/', ProductDetailView.as_view(), name='product-detail'), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.urls import path from product.views import (MainCategoryView, ProductDetailView, ProductListView, MainProductView, ProductListView, ProductReviewView, ProductQnaView, MyProductQnaView, QnaDetailView) urlpatterns = [ path('', ProductListView.as_view()), path('/main-category', MainCategoryView.as_view()), path('/main-product', MainProductView.as_view()), path('/detail/<int:product_id>', ProductDetailView.as_view()), path('/<int:product_id>/review', ProductReviewView.as_view()), path('/<int:product_id>/qna', ProductQnaView.as_view()), path('/<int:product_id>/myqna', MyProductQnaView.as_view()), path('/<int:product_id>/qna/<int:question_id>', QnaDetailView.as_view()) ]
from django.urls import path from product.views import CreateProductView, create_product, ProductListView, ProductDetailView, StarView urlpatterns = [ path('create/product/', create_product, name='create_product'), path('products/', ProductListView.as_view(), name='product_list'), path('product/<int:pk>/', ProductDetailView.as_view(), name='product_detail'), path('product/star/<int:pk>', StarView.as_view(), name='star'), ]
from django.urls import path from product.views import ProductDetailView, ReviewView, ProductListView urlpatterns = [path('/detail/<int:product_id>', ProductDetailView.as_view()), path('/category/<str:type>', ProductListView.as_view()), path('/<int:product_id>/review', ReviewView.as_view()), ]
from django.contrib import admin from django.urls import path from users.views import index, RegisterView, LoginView, logout from product.views import (ProductListView, ProductCreate, ProductDetail, ProductListAPI, ProductDetailAPI) from order.views import OrderCreate, OrderList urlpatterns = [ path('admin/', admin.site.urls), path('', index), path('register/', RegisterView.as_view()), path('login/', LoginView.as_view()), path('logout/', logout), path('product/', ProductListView.as_view()), path('product/create/', ProductCreate.as_view()), path('product/<int:pk>', ProductDetail.as_view()), path('order/', OrderList.as_view()), path('order/create/', OrderCreate.as_view()), path('api/product/', ProductListAPI.as_view()), path('api/product/<int:pk>/', ProductDetailAPI.as_view()) ]
from django.urls import re_path, path from product.views import ProductRetrieveView, ProductListView app_name = "product" urlpatterns = [ re_path("(?P<id>\d+)/", ProductRetrieveView.as_view(), name="products-rud"), re_path("", ProductListView.as_view(), name="product-create"), ]
"""base URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/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 product.views import ProductListView from django.conf.urls.static import static from django.conf import settings urlpatterns = [ path('admin/', admin.site.urls), path('store', ProductListView.as_view(), name='store') ] #Para tener acceso a las imagenes via url urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)