title: Django: NoReverse Match error and page not found
body: <p>I've gotten the NoReverse Match error before and I got it to work with a blind guess. and page not found I've always been able to fix so I'm really not sure what is going on.</p>
  
  <p>As far as I can tell everything should be working correctly, and I even compared this code to a previous project and it looks fine (I have been tinkering with it so it may not be exactly what I originally typed in).</p>
  
  <p>base.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  {% load staticfiles %}
  
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;title&gt;Evverest&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="{% static 'css/style.css' %}"&gt;
      &lt;/head&gt;
  
  &lt;body&gt;
  
      &lt;nav&gt;
          &lt;div class="container"&gt;
              &lt;a class="brand" href="{% url 'index' %}"&gt;Evverest&lt;/a&gt;
  
              &lt;div class="navbar"&gt;
                  &lt;a class="nav-link btn" href="{% url 'index' %}"&gt;Home&lt;/a&gt;
                  {% if user.is_authenticated %}
                      &lt;a class="nav-link" href="{% url 'users:user-profile' %}"&gt;New Color Set&lt;/a&gt;
                      &lt;a class="nav-link" href="{% url 'users:user_logout' %}"&gt;Logout&lt;/a&gt;
                  {% else %}
                      &lt;a class="nav-link" href="{% url 'users:user_login' %}"&gt;Login&lt;/a&gt;
                      &lt;a class="nav-link" href="{% url 'users:register' %}"&gt;Register&lt;/a&gt;
                  {% endif %}
              &lt;/div&gt;
          &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>app views.py</p>
  
  <pre><code>from django.shortcuts import render
  from users.forms import UserForm,UserProfileForm
  from users.models import UserProfileInfo
  
  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
  
  from django.contrib.auth.mixins import LoginRequiredMixin
  from django.views.generic import (TemplateView,ListView,
                                      DetailView,CreateView,
                                      UpdateView,DeleteView)
  
  # 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("Username and/or password are not correct")
  
      else:
          return render(request,'login.html',{})
  
  def register(request):
      registered = False
  
      if request.method == 'POST':
          user_form = UserForm(data=request.POST)
          profile_form = UserProfileForm(data=request.POST)
  
          if user_form.is_valid() and profile_form.is_valid():
              user = user_form.save()
              user.set_password(user.password)
              user.save()
  
              profile = profile_form.save(commit=False)
              profile.user = user
  
              if 'profile_pic' in request.FILES:
                  profile.profile_pic = request.FILES['profile_pic']
  
              profile.save()
              registered = True
          else:
              print(user_form.errors,profile_form.errors)
      else:
          user_form = UserForm()
          profile_form = UserProfileForm()
  
      return render(request,'register.html',{
                                          'user_form':user_form,
                                          'profile_form':profile_form,
                                          'registered':registered
                                          })
  
  @login_required
  def user_logout(request):
      logout(request)
      return HttpResponseRedirect(reverse('login'))
  
  class HomeView(ListView):
      model = UserProfileInfo
      ordering = ['-join_date']
  
  class UserProfileView(DetailView):
      model = UserProfileInfo
  
  class UserEditProfileView(LoginRequiredMixin,UpdateView):
      login_url = '/login/'
      redirect_field_name = '/users_detail.html'
      form_class = UserProfileForm
      model = UserProfileInfo
  </code></pre>
  
  <p>Project urls.py</p>
  
  <pre><code>from django.conf.urls import url
  from django.contrib import admin
  from django.conf.urls import include
  from users import views
  
  urlpatterns = [
      url(r'^admin/', admin.site.urls),
      url(r'^$',views.HomeView.as_view(),name='index'),
      url(r'^users/',include('users.urls',namespace='users')),
  ]
  </code></pre>
  
  <p>app urls.py</p>
  
  <pre><code>from django.conf.urls import url
  from users import views
  
  app_name = 'users'
  
  urlpatterns = [
      url(r'^login/$',views.user_login,name='user_login'),
      url(r'^logout/$',views.user_logout,name='user_logout',kwargs={'next_page':'/'}),
      url(r'^register/$',views.register,name='register'),
      url(r'(?P&lt;username&gt;\d+)/$',views.UserProfileView.as_view(),name='user-profile'),
      url(r'(?P&lt;username&gt;\d+)/edit$',views.UserEditProfileView.as_view(),name='user-profile-edit'),
  ]
  </code></pre>
  
  <p>file structure:</p>
  
  <p><a href="https://i.stack.imgur.com/Ptqu9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ptqu9.png" alt="enter image description here"></a></p>
  
  <p><strong>EDIT</strong>
  Here is the traceback:
  <a href="https://i.stack.imgur.com/NXEmC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NXEmC.png" alt="enter image description here"></a></p>