title: Class based views
body: <p>I'm experimenting with class based views as I've not worked with them yet. I'm also pretty new to Django. I'm having trouble correctly using slug or pk and setting up my URL's in my products app.</p>
  <p>My Project level urls.py:</p>
  <pre><code>from django.conf import settings
  from django.contrib import admin
  from django.urls import path, include
  
  urlpatterns = [
      path('admin/', admin.site.urls),
      path('accounts/', include('allauth.urls')),
      path('', include('home.urls', namespace='home')),
      path('products/', include('products.urls')),
      path('checkout/', include('checkout.urls')),
  ]
  </code></pre>
  <p>urls.py(product app):</p>
  <pre><code>from django.urls import path
  from .views import ItemDetailView
  
  urlpatterns = [
      path('', ItemDetailView.as_view(), name='products'),
  ]
  </code></pre>
  <p>views.py(products app):</p>
  <pre><code>from django.shortcuts import render
  from django.views.generic import DetailView
  from home.models import Item
  
  
  def products(request):
      context = {
          'items': Item.objects.all()
      }
      return render(request, &quot;products/products.html&quot;, context)
  
  
  class ItemDetailView(DetailView):
      model = Item
      template_name = &quot;products/product.html&quot;
  </code></pre>
  <p>I have tried adding <code>&lt;slug&gt;/</code> to the products url pattern but that doesn't work. I'm pretty sure I need to adjust my url's but I'm not sure how.</p>