title: the login field is not visible after implementing it
body: <p>I am trying to implement the login field using django's authenticationForm.</p>
  
  <p>the problem im having is that,because im trying to display two different forms inside one page (post_list) it seem to cause many errors.</p>
  
  <p>one is for login field, and one is for the posting articles.</p>
  
  <p>i also seem to have problem with duplicate forms as the two forms use the samename for the form which i do not know how to change.</p>
  
  <p>also, there an error occurring when i try to post something using the post form.</p>
  
  <p>to blatantly put, how do i make the login field visible?</p>
  
  <p>i refer you to the working site : <a href="http://mtode.com" rel="nofollow">http://mtode.com</a>( this is just a representation site, and do not contain login field part)</p>
  
  <p>this is my views py which contains the definitions</p>
  
  <pre><code>    from django.contrib import messages
  from django.http import HttpResponse, HttpResponseRedirect
  from django.shortcuts import render, get_object_or_404, redirect
  
  
  from .forms import PostForm, AuthenticationForm
  from .models import Post
  
  
  from django.contrib.auth import authenticate, login
  
  
  from django.contrib.auth import login
  from django.http import HttpResponseRedirect
  from django.template.response import TemplateResponse
  
  from django.contrib.auth.decorators import login_required
  
  
  
  def post_detail(request, id=None):
      #instance = Post.objects.get(id=1)
      instance = get_object_or_404(Post, id=id)
      context = {
          "title": instance.title,
          "instance": instance,
      }
      return render(request, "post_detail.html", context)
  
  def post_list(request):
  
  
  
      if request.method == "POST":
          form = AuthenticationForm(request, data=request.POST)
          if form.is_valid():
              login(request, form.get_user())
              return HttpResponseRedirect('/post-list/')
  
          else:
              form = AuthenticationForm(request)
  
              return TemplateResponse(request, 'login.html', {'form': form})
  
  
  
      form = PostForm(request.POST or None)
  
      if form.is_valid():
              instance = form.save(commit=False)
              print (form.cleaned_data.get("title"))
              instance.save()
              # message success
              messages.success(request, "Successfully Created")
              return HttpResponseRedirect(instance.get())
          #else:
              #messages.error(request, "Not Successfully Created")
      queryset = Post.objects.all()#.order_by("-timestamp")
      context = {
              "object_list": queryset,
              "title": "List",
              "form": form,
          }
      return render(request, "post_list.html", context)
      #return HttpResponse("&lt;h1&gt;List&lt;/h1&gt;")
  
  def post_update(request, id=None):
      instance = get_object_or_404(Post, id=id)
      form = PostForm(request.POST or None, instance=instance)
      if form.is_valid():
          instance = form.save(commit=False)
          instance.save()
          # message success
          messages.success(request, "Saved")
          return HttpResponseRedirect(instance.get_absolute_url())
      context = {
          "title": instance.title,
          "instance": instance,
          "form":form,
      }
      return render(request, "post_form.html", context)
  
  
  def post_delete(request, id=None):
      instance = get_object_or_404(Post, id=id)
      instance.delete()
      messages.success(request, "Successfully deleted")
      return redirect("posts:list")
  </code></pre>
  
  <p>and this is the forms.py that contains the forms</p>
  
  <pre><code>    from django import forms
  
  from .models import Post
  
  class PostForm(forms.ModelForm):
      class Meta:
          model = Post
          fields = [
          "title",
          "content"
          ]
  
  from django.contrib.auth import authenticate
  
  class AuthenticationForm(forms.Form):
      username = forms.CharField(max_length=254)
      password = forms.CharField(widget=forms.PasswordInput)
  
      def clean(self):
          username = self.cleaned_data['username']
          password = self.cleaned_data['password']
          user = authenticate(username=username, password=password)
          if user is None:
              raise forms.ValidationError('invalid_login')
  
          return self.cleaned_data
  </code></pre>
  
  <p>and this is the post_list.html</p>
  
  <pre><code>    {% extends "base.html" %}
  {% block content %}
  
  
  &lt;form method="post" action=""&gt;
      {% csrf_token %}
      Username: {{ form.username }} {{ form.username.errors }}&lt;br&gt;
      Password: {{ form.password }} {{ form.password.errors }}&lt;br&gt;
      {{ form.errors }}&lt;br&gt;
      &lt;input type="submit" value="login" /&gt;
  &lt;/form&gt;
  
  
  &lt;div class='two columns right mgr'&gt;
    &lt;h1&gt;Form&lt;/h1&gt;
  &lt;form method='POST' action=''&gt;{% csrf_token %}
  {{ form.as_p }}
  &lt;input class="button-primary" type='submit' value='Create Post' /&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  
  &lt;div class='four columns left'&gt;
    &lt;h1&gt;{{ title }}&lt;/h1&gt;
  
  {% for obj in object_list %}
  
  
  
  &lt;div class="row"&gt;
    &lt;div&gt;
      &lt;a href='{{ obj.get_absolute_url }}'&gt;
      &lt;div class="thumbnail"&gt;
        &lt;!--&lt;img src="..." alt="..."&gt;!--&gt;
        &lt;div class="caption"&gt;
          &lt;h3&gt;{{ obj.title }}&lt;small&gt; {{ obj.timestamp|timesince }} ago&lt;/small&gt;&lt;/h3&gt;
          &lt;p&gt;{{ obj.content|linebreaks|truncatechars:120 }}&lt;/p&gt;
        &lt;!--  &lt;p&gt;&lt;a href='{{ obj.get_absolute_url }}' class="btn btn-primary" role="button"&gt;View&lt;/a&gt; &lt;/p&gt;--&gt;
        &lt;/div&gt;
  
  
      &lt;/div&gt;&lt;/a&gt;
    &lt;/div&gt;
    &lt;hr /&gt;
  &lt;/div&gt;
  
  {% endfor %}
  
  &lt;/div&gt;
  {% endblock content %}
  </code></pre>
  
  <p>Thank you.</p>