title: Django redirecting to wrong view in other app
body: <p>After adding an other app to my django 1.6 project I ran into a strange problem with the HttpResponseRedirect function of django.</p>
  
  <p>I have a login view for both of the apps but when I try to login to the second app I got redirected to first_app/list instead to second_app/index.</p>
  
  <p>so in my first app the view is</p>
  
  <pre><code>def login(request):
  
  aut_form = auth.forms.AuthenticationForm()
  if(request.method == 'POST'):
      username = request.POST['username']
      password = request.POST['password']
      user = auth.authenticate(username=username, password=password)
      if user is not None:
          if user.is_active:
              auth.login(request, user)
              return HttpResponseRedirect(reverse('fist_app:list'))
          else:
              return HttpResponseRedirect(reverse('fist_app:login') + '?loggedout')
      else:
          return HttpResponseRedirect(reverse('fist_app:login') + '?invalid')
  else: 
      return render(request, 'first_app/login.html', {'form' : aut_form})
  
  def list(request):
  
  if  request.user is None or not request.user.is_authenticated():
      return HttpResponseRedirect(reverse('fist_app:login'))
  else:     
      return response
  </code></pre>
  
  <p>and in the second app the views.py looks pretty much the same</p>
  
  <pre><code>def login(request):
  
  aut_form = auth.forms.AuthenticationForm()
  if(request.method == 'POST'):
      username = request.POST['username']
      password = request.POST['password']
      user = auth.authenticate(username=username, password=password)
      if user is not None:
          if user.is_active:
              auth.login(request, user)
              print("success")
              return HttpResponseRedirect(reverse('second_app:index'))
          else:
              return HttpResponseRedirect(reverse('second_app:login') + '?loggedout')
      else:
          return HttpResponseRedirect(reverse('second_app:login') + '?invalid')
  else: 
      return render(request, 'second_app/login.html', {'form' : aut_form})
  
  def index(request):
  return render(request, 'second_app/index.html')
  </code></pre>
  
  <p>I also checked my urls.py in both apps of regular expressions that are too vague.</p>
  
  <p>urls.py of first_app</p>
  
  <pre><code>urlpatterns = patterns('first_app.views',
      url(r'^list/$', views.list, name='list' ),
      url(r'^login$', views.login, name='login'),
  )
  </code></pre>
  
  <p>urls.py of second app</p>
  
  <pre><code>urlpatterns = patterns('second_app.views',
     url(r'^login$', views.login, name='login'),
     url(r'^index$', views.index, name="index"),
  )
  </code></pre>
  
  <p>What do I have to change to get redirected to the correct view in the login-page related app?</p>
  
  <p>and my projects urls.py</p>
  
  <pre><code>urlpatterns = patterns('',
      url(r'^backend/', include('second_app.urls', namespace="second_app")),
      url(r'^polls/', include('first_app.urls', namespace="first_app")),
      url(r'^admin/', include(admin.site.urls)),
  )
  </code></pre>