title: How to pass a custom authentication form from within a view in django?
body: <p>I'm trying to pass a custom authentication form I created to the auth.views.login.</p>
  
  <p>All the tutorials I found do it through url() in urls.py, and with a url for the login view, for example:</p>
  
  <pre><code>url(r'^login/$', auth.views.login,{'authentication_form':MyAuthenticationForm})
  </code></pre>
  
  <p>But <strong>I want the url to be the same as the index url</strong>, if the user is authenticated then show the index otherwise show the login form with my custom authentication form.</p>
  
  <p>Here's my <strong>views.py</strong> :</p>
  
  <pre><code>from django.shortcuts import render
  from django.contrib.auth import views as auth_views
  
  
  def cp(request):
    if request.user.is_authenticated():
        return render(request, 'index.html')
  
    # How to pass my custom authentication form ?
    return auth_views.login(request)
  </code></pre>
  
  <p>This is working, but how do I tell django my custom authentication form?</p>