from django.urls import path
from . import views
urlpatterns = [
path('', views.product_list, name='product_list'),
path('category/<category_slug>/', views.product_list, name='product_list_by_category')
path('product/<slug:slug>/<int:id>/', views.product_detail, name='product_detail')
]
try:
products = paginator.page(page)
except PageNotAnInteger:
products = paginator.page(1)
except EmptyPage:
products = paginator.page(paginator.num_pages)
return render(request,
'products/list.html',
{'category': category,
'categories': categories,
'products': products,
'page': page})
page = request.GET.get('page')
paginator = Paginator(products, 3)
Я пользуюсь дебаггером в pycharm