title: How To Correctly Define 'get_absoute_url' in Django?
body: <p>Can you please help me to correctly define the <strong>get_absolute_url</strong>? Right now I'm been redirected to <strong>'.../product/32949492331'</strong>, however the url should look like: <strong>'.../product/1'</strong>, <strong>'.../product/2'</strong>, etc. 
  Here is <strong>models.py</strong>:</p>
  
  <pre><code>class Product(models.Model):
      product_id = models.CharField(max_length=50)
      pub_date = models.DateTimeField(default=datetime.now)
      title = models.CharField(max_length=255)
      url = models.TextField()
      price = models.FloatField()
  
      def get_absolute_url(self):
          return reverse('detail', kwargs={'product_id': self.product_id})
  </code></pre>
  
  <p><strong>views.py:</strong></p>
  
  <pre><code>def detail(request, product_id):
      product = get_object_or_404(Product, pk=product_id)
      return render(request, 'product/detail.html', {'product': product})
  </code></pre>
  
  <p><strong>urls.py:</strong></p>
  
  <pre><code>urlpatterns = [
      path('add', views.add, name='add'),
      path('&lt;int:product_id&gt;', views.detail, name='detail'),
  ]
  </code></pre>
  
  <p>This is a follow up to my <a href="https://stackoverflow.com/questions/55670417/how-to-render-an-object-in-django-views">previous question</a>. Thanks in advance for your help!</p>