title: NoReverseMatch error Django with slug
body: <p>I'm trying to make the index view show a list of "Journal"s, with each linking to a view that lists "Manuscripts" in the Journal. I also want <code>journal_view</code> to be located at a slug for the name of the journal, and likewise for <code>manuscript_view</code>.</p>
  
  <h1>This is the traceback I get:</h1>
  
  <pre><code>Environment:
  Request Method: GET
  Request URL: http://127.0.0.1:8000/journals/
  
  Django Version: 2.0.3
  Python Version: 3.6.4
  Installed Applications:
  ['social_django',
   'django.contrib.admin',
   'django.contrib.auth',
   'django.contrib.contenttypes',
   'django.contrib.sessions',
   'django.contrib.messages',
   'django.contrib.staticfiles',
   'journal.apps.JournalConfig']
  Installed Middleware:
  ['django.middleware.security.SecurityMiddleware',
   'django.contrib.sessions.middleware.SessionMiddleware',
   'django.middleware.common.CommonMiddleware',
   'django.middleware.csrf.CsrfViewMiddleware',
   'django.contrib.auth.middleware.AuthenticationMiddleware',
   'django.contrib.messages.middleware.MessageMiddleware',
   'django.middleware.clickjacking.XFrameOptionsMiddleware']
  
  
  Template error:
  In template ... error at line 8
     Reverse for 'view_journal' not found. 'view_journal' is not a valid view function or pattern name.
     1 : {% load static %}
     2 : 
     3 : &lt;link rel="stylesheet" type="text/css" href="{% static 'journal/style.css' %}" /&gt;
     4 : 
     5 : {% if journal_list %}
     6 :     &lt;ul&gt;
     7 :     {% for journal in journal_list %}
     8 :         &lt;li&gt;&lt;a href=" {% url journal.get_absolute_url journal.slug %} "&gt;{{ journal.title }}&lt;/a&gt;&lt;/li&gt;
     9 :     {% endfor %}
     10 :     &lt;/ul&gt;
     11 : {% else %}
     12 :     &lt;p&gt;No journals are available.&lt;/p&gt;
     13 : {% endif %}
  
  # ...(Traceback)...
  
      Exception Type: NoReverseMatch at /journals/
      Exception Value: Reverse for 'view_journal' not found. 'view_journal' is not a valid view function or pattern name.
  </code></pre>
  
  <h1>The Journal model looks like this:</h1>
  
  <pre><code>class Journal(models.Model):
      title = models.CharField(max_length=100, unique=True)
      slug = models.SlugField(unique=True)
      # blah blah
  
      def __str__(self):
          return self.title
  
      def get_absolute_url(self, *args, **kwargs):
          return reverse("view_journal", kwargs={"slug": self.slug})
  </code></pre>
  
  <h1>My views look like this:</h1>
  
  <pre><code>class IndexView(generic.ListView):   
      template_name = 'journal/index.html'
      context_object_name = 'journal_list'
  
      def get_queryset(self):
          return Journal.objects.all()
  
  
  class JournalView(generic.ListView):
      template_name = 'journal/journal.html'
      context_object_name = 'latest_article_list'
  
      def get_queryset(self):
          return Manuscript.objects.filter(
                                      pub_date__lte=timezone.now()
                                          ).order_by('-pub_date')[:5]
  </code></pre>
  
  <h1>My app urls look like this:</h1>
  
  <pre><code>app_name = 'journal'
  urlpatterns = [
      path('', views.IndexView.as_view(), name='index'),
      path('&lt;slug&gt;/', views.JournalView.as_view(), name='view_journal'),
      path('&lt;slug&gt;/', views.ArticleView.as_view(), name='view_manuscript'), ]
  </code></pre>
  
  <h1>Project urls:</h1>
  
  <pre><code>from django.contrib import admin
  from django.urls import path, include
  
  urlpatterns = [
      path('admin/', admin.site.urls),
      path('journals/', include('journal.urls')),
      path('social/', include('social.apps.django_app.urls', namespace='social')),
  ]
  </code></pre>