title: NoReverseMatch at /colorsets/new/ Reverse for 'user_logout' not found. 'user_logout' is not a valid view function or pattern name
body: <p>I'm getting this error when trying to click on the "New Color Set" button: </p>
  
  <pre><code>NoReverseMatch at /colorsets/new/
  Reverse for 'user_logout' not found. 'user_logout' is not a valid view function or pattern name.
  </code></pre>
  
  <p>I've looked extensively through StackOverflow and elsewhere on other sites and can't seem to find what the issue is. As far a I can tell all my code is right but clearly there is an issue.</p>
  
  <p>base.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;title&gt;Colors&lt;/title&gt;
  
          &lt;meta name"viewport" content="width=device-width, initial-scale=1"&gt;
          &lt;meta charset="uft-8"&gt;
          &lt;link rel="shortcut icon" href="/images/favicon.ico"&gt;
          &lt;link rel="stylesheet" href="/style.css"&gt;
      &lt;/head&gt;
  
  &lt;body&gt;
  
      &lt;nav&gt;
          &lt;div class="container"&gt;
              &lt;a class="btn" href="{% url 'index' %}"&gt;Home&lt;/a&gt;
              {% if user.is_authenticated %}
                  &lt;a class="btn" href="{% url 'colorsets:new_color' %}"&gt;New Color Set&lt;/a&gt;
                  &lt;a class="btn" href="{% url 'accounts:user_logout' %}"&gt;Logout&lt;/a&gt;
              {% else %}
                  &lt;a class="btn" href="{% url 'accounts:user_login' %}"&gt;Login&lt;/a&gt;
                  &lt;a class="btn" href="{% url 'accounts:register' %}"&gt;Register&lt;/a&gt;
              {% endif %}
          &lt;/div&gt;
      &lt;/nav&gt;
  
      &lt;div class="container"&gt;
          {% block content %}
          {% endblock %}
      &lt;/div&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>Views.py</p>
  
  <pre><code>from django.shortcuts import render
  from accounts.forms import UserForm
  
  from django.contrib.auth import authenticate,login,logout
  from django.http import HttpResponseRedirect, HttpResponse
  from django.core.urlresolvers import reverse
  from django.contrib.auth.decorators import login_required
  
  # Create your views here.
  def user_login(request):
      if request.method == 'POST':
          username = request.POST.get('username')
          password = request.POST.get('password')
  
          user = authenticate(username=username,password=password)
  
          if user:
              if user.is_active:
                  login(request,user)
                  return HttpResponseRedirect(reverse('index'))
              else:
                  return HttpResponse("Account now active")
  
          else:
              print("Login Unsuccessful")
              return HttpResponse("Your username and/or password are not correct")
  
      else:
          return render(request,'accounts/login.html',{})
  
  def register(request):
      registered = False
  
      if request.method == 'POST':
          user_form = UserForm(data=request.POST)
  
          if user_form.is_valid():
              user = user_form.save()
              user.set_password(user.password)
  
              registered = True
          else:
              print(user_form.errors)
  
      else:
          user_form = UserForm()
  
      return render(request,'accounts/register.html',{'user_form':user_form,'registered':registered})
  
  @login_required
  def user_logout(request):
      logout(request)
      return HttpResponseRedirect(reverse('index'))
  
  accounts app urls.py
  
      from django.conf.urls import url
      from accounts import views
  
      app_name = 'accounts'
  
      urlpatterns = [
          url(r'^register/$',views.register,name='register'),
          url(r'^login/$',views.user_login,name='user_login'),
          url(r'^logout/',views.user_logout,name='user_logout'),
      ]
  </code></pre>
  
  <p>project urls.py</p>
  
  <pre><code>"""colors URL Configuration
  
  The `urlpatterns` list routes URLs to views. For more information please see:
      https://docs.djangoproject.com/en/1.11/topics/http/urls/
  Examples:
  Function views
      1. Add an import:  from my_app import views
      2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
  Class-based views
      1. Add an import:  from other_app.views import Home
      2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
  Including another URLconf
      1. Import the include() function: from django.conf.urls import url, include
      2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
  """
  from django.conf.urls import url
  from django.contrib import admin
  from django.conf.urls import include
  from accounts import views
  from colorsets import views
  
  urlpatterns = [
      url(r'^admin/', admin.site.urls),
      url(r'^$',views.index,name='index'),
      url(r'^accounts/',include('accounts.urls',namespace='accounts')),
       url(r'^colorsets/',include('colorsets.urls',namespace='colorsets')),
  ]
  </code></pre>
  
  <p>Let me know if you need to see anything else.</p>