title: NoReverseMatch (Reverse for ' user_login' not found)
body: <p>I have a django project called log and an application called basic_app. I created a register form but when I want to create a user_login, I get this error:</p>
  
  <p>NoReverseMatch at /basic_app/user_login/
  Reverse for ' user_login' not found. ' user_login' is not a valid view function or pattern name.</p>
  
  <p>views.py:</p>
  
  <pre><code>from django.shortcuts import render
  from basic_app.forms import UserForm, UserProfileInfoForm
  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 index(request):
      return render(request, 'basic_app/index.html')
  
  
  @login_required
  def special(request):
      return HttpResponse('You are loged in!')
  
  @login_required
  def user_logout(request):
      logout(request)
      return HttpResponseRedirect(reverse('index'))
  
  
  
  
  def register(request):
      registered = False
  
      if request.method == 'POST':
          user_form = UserForm(data=request.POST)
          profile_form = UserProfileInfoForm(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 = UserProfileInfoForm()
  
      return render(request, 'basic_app/registration.html',
                               {'user_form':user_form,
                                'profile_form':profile_form,
                                'registered':registered})
  
  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 Not Active.')
  
          else:
              print('Someone tried to login and failed!')
              print('username:{} and password:{}'.format(username, password))
              return HttpResponse('invalid login details supplied!')
  
      else:
          return render(request, 'basic_app/login.html',{})
  </code></pre>
  
  <p>basic_app/urls.py:</p>
  
  <pre><code>from django.conf.urls import url
  from basic_app import views
  
  #TEMPLATE URLS
  
  app_name = 'basic_app'
  
  urlpatterns = [
      url(r'^register/$', views.register, name='register'),
      url(r'^user_login/$', views.user_login, name='user_login'),
  </code></pre>
  
  <p>log/urls.py:</p>
  
  <pre><code>from django.conf.urls import url, include
  from django.contrib import admin
  from basic_app import views
  
  urlpatterns = [
      url(r'^$', views.index, name='index'),
      url(r'^admin/', admin.site.urls),
      url(r'^basic_app/', include('basic_app.urls')),
      url(r'^logout/$', views.user_logout, name='logout'),
      url(r'special/', views.special, name='special')
  </code></pre>
  
  <p>login.html:</p>
  
  <pre><code>{% extends 'basic_app/basic.html' %}
  {% block body_block %}
  
  &lt;div class="jumbotron"&gt;
      &lt;h1&gt;Please Login: &lt;/h1&gt;
      &lt;form action="{% url 'basic_app: user_login' %}" method="post"&gt;
  
          {% csrf_token %}
          &lt;label for="username"&gt;Username:&lt;/label&gt;
          &lt;input type="text" name="username" placeholder="Enter Username"&gt;
  
          &lt;label for="passwrod"&gt;Password:&lt;/label&gt;
          &lt;input type="password" name="password"&gt;
  
          &lt;input type="submit" name="" value="Login"&gt;
  
      &lt;/form&gt;
  
  
  &lt;/div&gt;
  
  
  {% endblock %}
  </code></pre>