title: Django Rest Framework - Router Register not working
body: <p>I'm using django rest framework to generate an api. In it I have two models, associated views and serializers. These are <code>beers</code> and <code>pours</code>. The <code>beers</code> api endpoint works as expected, but whenever I try to access the <code>pours</code> endpoint I get the following error:</p>
  
  <p><code>Could not resolve URL for hyperlinked relationship using view name "pours-detail". You may have failed to include the related model in your API, or incorrectly configured the 'lookup_field' attribute on this field.</code></p>
  
  <p>I'm not quite sure what I am doing wrong, can someone point out the error?</p>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>from __future__ import unicode_literals
  
  from django.db import models
  from django.utils import timezone
  
  
  class Beers(models.Model):
      """
      Beers
      """
      # The unique id
      id = models.AutoField(primary_key=True)
      # Timestamps
      created_at = models.DateTimeField(default=None, null=True)
      updated_at = models.DateTimeField(default=None, null=True)
      tap = models.PositiveIntegerField(default=None, null=True)
      url = models.CharField(max_length=255, default=None, null=True)
      abv = models.DecimalField(default=None, null=True, decimal_places=2, max_digits=3)
      style = models.CharField(max_length=255, default=None, null=True)
      score = models.PositiveIntegerField(default=None, null=True)
      tap_date = models.PositiveIntegerField(default=None, null=True)
      size = models.PositiveIntegerField(default=None, null=True)
  
      def save(self, *args, **kwargs):
          """
          On save, update timestamps
          """
          # If the record does not currently exist in the database
          self.created_at = timezone.now()
          self.updated_at = timezone.now()
  
          return super(Beers, self).save(*args, **kwargs)
  
      class Meta:
          db_table = 'beers'
          index_together = [("tap", "tap_date")]
  
  
  class Pours(models.Model):
      """
      Handles pours
      """
      id = models.AutoField(primary_key=True)
      tap = models.PositiveIntegerField()
      amount = models.DecimalField(decimal_places=3, max_digits=19)
      date = models.PositiveIntegerField()
  
      def save(self, *args, **kwargs):
          """
          On save, update timestamps
          """
          return super(Pours, self).save(*args, **kwargs)
  
      class Meta:
          db_table = 'pours'
          index_together = [("tap", "date")]
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>from rest_framework import viewsets
  from rest_framework.renderers import JSONRenderer
  
  from .serializers import *
  from .models import *
  
  import logging
  
  logger = logging.getLogger(__name__)
  
  
  class PoursView(viewsets.ModelViewSet):
      """
      Handles pours
      """
      permission_classes = ()
      throttle_classes = ()
      authentication_classes = ()
  
      renderer_classes = (JSONRenderer,)
  
      queryset = Pours.objects.all()
      serializer_class = PoursSerialzier
  
  
  class BeersView(viewsets.ModelViewSet):
      """
      Handles beers
      """
      permission_classes = ()
      throttle_classes = ()
      authentication_classes = ()
  
      renderer_classes = (JSONRenderer,)
  
      queryset = Beers.objects.all()
      serializer_class = BeersSerialzier
  </code></pre>
  
  <p><strong>serializers.py</strong></p>
  
  <pre><code>from rest_framework import serializers
  from .models import *
  
  
  class BeersSerialzier(serializers.HyperlinkedModelSerializer):
      queryset = Beers.objects.all()
  
      class Meta:
          model = Beers
  
  
  class PoursSerialzier(serializers.HyperlinkedModelSerializer):
      queryset = Pours.objects.all()
  
      class Meta:
          model = Pours
  </code></pre>
  
  <p><strong>urls.py</strong></p>
  
  <pre><code>from django.conf.urls import include, patterns, url
  from rest_framework import routers
  
  import views
  
  router = routers.DefaultRouter()
  router.register(r'beers', views.BeersView)
  router.register(r'pours', views.PoursView)
  
  urlpatterns = [
      url('^', include(router.urls)),
  ]
  </code></pre>