title: NoReverseMatch at /Gyobera/
body: <p>I am new to django; though same bugs have been tackled here, I honestly can't locate where my code has gone wrong.</p>
  
  <p>This is the error I get:</p>
  
  <pre><code>NoReverseMatch at /Gyobera/
  Reverse for 'classification' with arguments '()' and keyword arguments '{}' not found. 1 pattern(s) tried: ['classification/(?P&lt;classification_name_url&gt;\\w+)/$']
  Request Method: GET
  Request URL:    http://127.0.0.1:8000/Gyobera/
  Django Version: 1.8.2
  Exception Type: NoReverseMatch
  Exception Value:    
  Reverse for 'classification' with arguments '()' and keyword arguments '{}' not found. 1 pattern(s) tried: ['classification/(?P&lt;classification_name_url&gt;\\w+)/$']
  Exception Location: C:\Python34\lib\site-packages\django\core\urlresolvers.py in _reverse_with_prefix, line 496
  Python Executable:  C:\Python34\python.exe
  Python Version: 3.4.2
  Python Path:    
  ['C:\\Users\\Scott Businge\\Ewange',
   'C:\\Python34\\lib\\site-packages\\pip-7.1.0-py3.4.egg',
   'C:\\Users\\Scott Businge\\Ewange',
   'C:\\WINDOWS\\SYSTEM32\\python34.zip',
   'C:\\Python34\\DLLs',
   'C:\\Python34\\lib',
   'C:\\Python34',
   'C:\\Users\\Scott Businge\\AppData\\Roaming\\Python\\Python34\\site-packages',
   'C:\\Python34\\lib\\site-packages']
  Server time:    Mon, 15 Feb 2016 08:48:43 +0300
  </code></pre>
  
  <p>Links can't be clicked to show detailed pages, everytime I click it shows the error from the index page which I will post here down. I am only using the project urls(Ewange)</p>
  
  <p>index.html</p>
  
  <pre><code>        &lt;h2&gt;&lt;strong&gt;Main Classifications&lt;/strong&gt;&lt;/h2&gt;
            {% if classifications %}
              &lt;ul&gt;
                  {% for classification in classifications %}
                   &lt;!-- Following line changed to add an HTML hyperlink --&gt;
                  &lt;li&gt;&lt;a href="{% url 'classification' classification.url %}"&gt;{{ classification.name }}&lt;/a&gt;&lt;/li&gt;
                  {% endfor %}
              &lt;/ul&gt;
          {% else %}
              &lt;strong&gt;There are no classifications present.&lt;/strong&gt;
          {% endif %}
  {% endblock %}
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>url(r'^classification/(?P&lt;classification_name_url&gt;\w+)/$', views.classification,
                             name='classification'),
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>def index(request):
      context = RequestContext(request)
      classification_list = Classification.objects.order_by('-likes')[:6]
      context_dict = {'classifications': classification_list}
      for classification in classification_list:
          classification.url = classification.name.replace(' ', '_')
      return render_to_response('index.html', context_dict, context)
  
  def classification(request, classification_name_url):
      context = RequestContext(request)
      classification_name = classification_name_url.replace('_', ' ')
      context_dict = {'classification_name': classification_name, 'classification_name_url': classification_name_url}
      try:
          classification = Classification.objects.get(name=classification_name)
          context_dict['classification'] = classification
          lists = List.objects.filter(classification=classification)
          context_dict['lists'] = lists
      except Classification.DoesNotExist:
          return render_to_response('gyobera/classification.html', context_dict, context)
  </code></pre>
  
  <p>classification.html</p>
  
  <pre><code>&lt;h1&gt;{{ classification_name }}&lt;/h1&gt;
  {% if classification %}
      {% if lists %}
      &lt;ul&gt;
          {% for list in lists %}
          &lt;li&gt;&lt;a href="{{ list.title }}"&gt;{{ list.title }}&lt;/a&gt;&lt;/li&gt;
          {% endfor %}
      &lt;/ul&gt;
      {% else %}
          &lt;strong&gt;No lists currently in classification.&lt;/strong&gt;
      {% endif %}
  {% else %}
      The specified classification {{ classification_name }} does not exist!
  {% endif %}
  </code></pre>
  
  <p>
      </p>
  
  <p>setings.py</p>
  
  <pre><code>INSTALLED_APPS = (
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'Gyobera',
  )
  
  MIDDLEWARE_CLASSES = (
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
      'django.middleware.security.SecurityMiddleware',
  )
  
  ROOT_URLCONF = 'Ewange.urls'
  </code></pre>
  
  <p>when i run the server, i still get the "NoReverseMatchError"
  here is the current state of the urls.py, views.py and link in the index.html.
  what i was asking is, after correcting the classification.list_set, do u have to change the context_dict and url matching in views and urls.py respectively..</p>
  
  <pre><code>NoReverseMatch at /Gyobera/
  Reverse for 'classification' with arguments '('',)' and keyword arguments '{}' not found. 1 pattern(s) tried: ['classification/(?P&lt;classification_name_url&gt;\\w+)/$']
  Request Method: GET
  Request URL:    http://127.0.0.1:8000/Gyobera/
  Django Version: 1.8.2
  Exception Type: NoReverseMatch
  Exception Value:    
  Reverse for 'classification' with arguments '('',)' and keyword arguments '{}' not found. 1 pattern(s) tried: ['classification/(?P&lt;classification_name_url&gt;\\w+)/$']
  Exception Location: C:\Python34\lib\site-packages\django\core\urlresolvers.py in _reverse_with_prefix, line 496
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>url(r'^classification/(?P&lt;classification_name_url&gt;\w+)/$', views.classification,
                             name='classification'),
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>def classification(request, classification_name_url):
      context = RequestContext(request)
      classification_name = classification_name_url.replace('_', ' ')
      context_dict = {'classification_name': classification_name, 'classification_name_url': classification_name_url}
      try:
          classification = Classification.objects.get(name=classification_name)
          context_dict['classification'] = classification
          lists = List.objects.filter(classification=classification)
          context_dict['lists'] = lists
      except Classification.DoesNotExist:
          return render_to_response('gyobera/classification.html', context_dict, context)
  </code></pre>
  
  <p>index.html</p>
  
  <pre><code>  {% if classifications %}
      &lt;ul&gt;
          {% for classification in classifications %}
           &lt;!-- Following line changed to add an HTML hyperlink --&gt;
          &lt;li&gt;&lt;a href="{% url 'classification' classification.list_set.url %}"&gt;&lt;/a&gt;&lt;/li&gt;
          {% endfor %}
      &lt;/ul&gt;
  {% else %}
  </code></pre>