title: Dynamic URL routing for a class-based view
body: <p>I want to turn a function view into a class-based view.</p>
  <p>Here is the View &amp; URL path that I have right now.</p>
  <p>View:</p>
  <pre><code>def customer(request, pk):
      customer = Customer.objects.get(id=pk)
      return render(request, 'accounts/customer.html)
  </code></pre>
  <p>URL Path:</p>
  <pre><code>path('customer/&lt;str:pk&gt;/, views.customer, name='customer')
  </code></pre>
  <p>What would the proper syntax be to turn this view into a class-based view.
  I am mainly curious about how to access the primary key here using a class-based view.</p>
  <p>Thanks!</p>